[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Libunwind-devel] Error compiling libunwind 1.0.1 in a linux/ia64

From: Ken Werner
Subject: Re: [Libunwind-devel] Error compiling libunwind 1.0.1 in a linux/ia64
Date: Tue, 11 Oct 2011 15:45:58 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1

On 09/23/2011 08:03 PM, Arun Sharma wrote:
On Mon, Sep 19, 2011 at 5:59 AM, Harald Servat<address@hidden>  wrote:
Hash: SHA1


I was compiling libunwind 1.0.1 in a linux/ia64 machine when I found the
following error:

gcc -DHAVE_CONFIG_H -I. -I../include  -I../include
- -I../include/tdep-ia64 -I. -D_GNU_SOURCE -DNDEBUG  -g -O2 -fexceptions
- -Wall -Wsign-compare -MT ptrace/_UPT_find_proc_info.o -MD -MP -MF
$depbase.Tpo -c -o ptrace/_UPT_find_proc_info.o
mv -f $depbase.Tpo $depbase.Po
ptrace/_UPT_find_proc_info.c:102: error: conflicting types for
ptrace/_UPT_internal.h:72: error: previous declaration of
‘_UPTi_find_unwind_table’ was here
make[2]: *** [ptrace/_UPT_find_proc_info.o] Error 1

This came from commit b317cb48296ca3837b403782c317f6214a54a7fa.
I'll fix this one up. Ken: let me know if there is a good reason to
change the return type to int.

Whoops, I'm sorry. I didn't intend to break any other platforms.

The original _UPTi_find_unwind_table code returned a pointer to ui->di_cache which is redundant since ui pointer is an argument of this function. However, the unfortunate thing about returning a pointer of ui->di_cache is that it indicates only one unw_dyn_info_t can be retrieved which is not true in case there are multiple ways to unwind (e.g. DWARF and platform specific unwind tables). The local unwinding deals with this issue by returning only an int that indicates whether the operation was successful or not (see: dwarf/Gfind_proc_info-lsb.c:dwarf_callback()) and store multiple unw_dyn_info_t (see: cb_data->di_debug, cb_data->di) in a structure that gets passed as an argument. In case of remote unwinding I changed the return to int to be as close as possible to what works for local unwinding. Unfortunately I forgot about the IA64 code path and didn't notice that ptrace/_UPT_get_dyn_info_list_addr.c:get_list_addr() calls _UPTi_find_unwind_table to obtain the unw_dyn_info_t.

Commit 962366dace4fed902ad5e89df1b34c13c3224b8b changes the return type to unw_dyn_info_t* but doesn't change the code that assumes the return type is an integer. In addition to the return type this commit accidentally changed the name of the function (a missing underscore). Therefore there is no declaration for the functions defined in src/ptrace/_UPT_find_proc_info.c for the compiler to check against. This hides the fact that the _UPTi_find_unwind_table function for non IA64 targets still returns an integer.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]