From d93d96ad833390519ea68a2df22dd55dd26a3214 Mon Sep 17 00:00:00 2001 From: Martin Milata Date: Tue, 22 May 2012 11:51:06 +0200 Subject: [PATCH] Fix compilation on IA64 - Add tdep macro for {dwarf,ia64}_find_unwind_table so that ia64 doesn't try to use dwarf code. - Fix extraneous #if. - Fix mistyped filename in Makefile.am. - Link ia64-specific tests with correct libraries. Signed-off-by: Martin Milata --- include/tdep-arm/libunwind_i.h | 1 + include/tdep-hppa/libunwind_i.h | 1 + include/tdep-ia64/libunwind_i.h | 1 + include/tdep-mips/libunwind_i.h | 1 + include/tdep-ppc32/libunwind_i.h | 1 + include/tdep-ppc64/libunwind_i.h | 1 + include/tdep-x86/libunwind_i.h | 1 + include/tdep-x86_64/libunwind_i.h | 1 + src/Makefile.am | 4 ++-- src/ia64/Gfind_unwind_table.c | 3 --- src/ptrace/_UPT_find_proc_info.c | 2 +- src/ptrace/_UPT_get_dyn_info_list_addr.c | 2 +- tests/Makefile.am | 11 +++++++++++ 13 files changed, 23 insertions(+), 7 deletions(-) diff --git a/include/tdep-arm/libunwind_i.h b/include/tdep-arm/libunwind_i.h index a6c515db..af92f413 100644 --- a/include/tdep-arm/libunwind_i.h +++ b/include/tdep-arm/libunwind_i.h @@ -234,6 +234,7 @@ dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val) /* Platforms that support UNW_INFO_FORMAT_TABLE need to define tdep_search_unwind_table. */ #define tdep_search_unwind_table UNW_OBJ(search_unwind_table) +#define tdep_find_unwind_table dwarf_find_unwind_table #define tdep_uc_addr UNW_ARCH_OBJ(uc_addr) #define tdep_get_elf_image UNW_ARCH_OBJ(get_elf_image) #define tdep_access_reg UNW_OBJ(access_reg) diff --git a/include/tdep-hppa/libunwind_i.h b/include/tdep-hppa/libunwind_i.h index ef0bb5aa..f2168499 100644 --- a/include/tdep-hppa/libunwind_i.h +++ b/include/tdep-hppa/libunwind_i.h @@ -227,6 +227,7 @@ dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val) /* Platforms that support UNW_INFO_FORMAT_TABLE need to define tdep_search_unwind_table. */ #define tdep_search_unwind_table dwarf_search_unwind_table +#define tdep_find_unwind_table dwarf_find_unwind_table #define tdep_uc_addr UNW_ARCH_OBJ(uc_addr) #define tdep_get_elf_image UNW_ARCH_OBJ(get_elf_image) #define tdep_access_reg UNW_OBJ(access_reg) diff --git a/include/tdep-ia64/libunwind_i.h b/include/tdep-ia64/libunwind_i.h index 619425c1..71e4310b 100644 --- a/include/tdep-ia64/libunwind_i.h +++ b/include/tdep-ia64/libunwind_i.h @@ -222,6 +222,7 @@ struct ia64_global_unwind_state /* Platforms that support UNW_INFO_FORMAT_TABLE need to define tdep_search_unwind_table. */ #define tdep_search_unwind_table unw_search_ia64_unwind_table +#define tdep_find_unwind_table ia64_find_unwind_table #define tdep_find_proc_info UNW_OBJ(find_proc_info) #define tdep_uc_addr UNW_OBJ(uc_addr) #define tdep_get_elf_image UNW_ARCH_OBJ(get_elf_image) diff --git a/include/tdep-mips/libunwind_i.h b/include/tdep-mips/libunwind_i.h index 5713d95d..f2bc8936 100644 --- a/include/tdep-mips/libunwind_i.h +++ b/include/tdep-mips/libunwind_i.h @@ -282,6 +282,7 @@ dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val) /* Platforms that support UNW_INFO_FORMAT_TABLE need to define tdep_search_unwind_table. */ #define tdep_search_unwind_table dwarf_search_unwind_table +#define tdep_find_unwind_table dwarf_find_unwind_table #define tdep_uc_addr UNW_ARCH_OBJ(uc_addr) #define tdep_get_elf_image UNW_ARCH_OBJ(get_elf_image) #define tdep_access_reg UNW_OBJ(access_reg) diff --git a/include/tdep-ppc32/libunwind_i.h b/include/tdep-ppc32/libunwind_i.h index 292da621..7e669977 100644 --- a/include/tdep-ppc32/libunwind_i.h +++ b/include/tdep-ppc32/libunwind_i.h @@ -257,6 +257,7 @@ dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val) /* Platforms that support UNW_INFO_FORMAT_TABLE need to define tdep_search_unwind_table. */ #define tdep_search_unwind_table dwarf_search_unwind_table +#define tdep_find_unwind_table dwarf_find_unwind_table #define tdep_uc_addr UNW_ARCH_OBJ(uc_addr) #define tdep_get_elf_image UNW_ARCH_OBJ(get_elf_image) #define tdep_access_reg UNW_OBJ(access_reg) diff --git a/include/tdep-ppc64/libunwind_i.h b/include/tdep-ppc64/libunwind_i.h index 31c9ccf0..aa979b96 100644 --- a/include/tdep-ppc64/libunwind_i.h +++ b/include/tdep-ppc64/libunwind_i.h @@ -257,6 +257,7 @@ dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val) /* Platforms that support UNW_INFO_FORMAT_TABLE need to define tdep_search_unwind_table. */ #define tdep_search_unwind_table dwarf_search_unwind_table +#define tdep_find_unwind_table dwarf_find_unwind_table #define tdep_uc_addr UNW_ARCH_OBJ(uc_addr) #define tdep_get_elf_image UNW_ARCH_OBJ(get_elf_image) #define tdep_access_reg UNW_OBJ(access_reg) diff --git a/include/tdep-x86/libunwind_i.h b/include/tdep-x86/libunwind_i.h index 1f2e1449..ddcdc10b 100644 --- a/include/tdep-x86/libunwind_i.h +++ b/include/tdep-x86/libunwind_i.h @@ -243,6 +243,7 @@ dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val) /* Platforms that support UNW_INFO_FORMAT_TABLE need to define tdep_search_unwind_table. */ #define tdep_search_unwind_table dwarf_search_unwind_table +#define tdep_find_unwind_table dwarf_find_unwind_table #define tdep_uc_addr UNW_ARCH_OBJ(uc_addr) #define tdep_get_elf_image UNW_ARCH_OBJ(get_elf_image) #define tdep_access_reg UNW_OBJ(access_reg) diff --git a/include/tdep-x86_64/libunwind_i.h b/include/tdep-x86_64/libunwind_i.h index c4c69600..3bd0101c 100644 --- a/include/tdep-x86_64/libunwind_i.h +++ b/include/tdep-x86_64/libunwind_i.h @@ -184,6 +184,7 @@ dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val) /* Platforms that support UNW_INFO_FORMAT_TABLE need to define tdep_search_unwind_table. */ #define tdep_search_unwind_table dwarf_search_unwind_table +#define tdep_find_unwind_table dwarf_find_unwind_table #define tdep_get_elf_image UNW_ARCH_OBJ(get_elf_image) #define tdep_access_reg UNW_OBJ(access_reg) #define tdep_access_fpreg UNW_OBJ(access_fpreg) diff --git a/src/Makefile.am b/src/Makefile.am index af8d5781..10a61a11 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -191,7 +191,7 @@ libunwind_la_SOURCES_ia64 = $(libunwind_la_SOURCES_ia64_common) \ ia64/Lglobal.c ia64/Linit.c ia64/Linit_local.c ia64/Linit_remote.c \ ia64/Linstall_cursor.S ia64/Lis_signal_frame.c ia64/Lparser.c \ ia64/Lrbs.c ia64/Lregs.c ia64/Lresume.c ia64/Lscript.c ia64/Lstep.c \ - ia64/Ltables.c ia64/Lfind_unwind_tables.c + ia64/Ltables.c ia64/Lfind_unwind_table.c # The list of files that go into libunwind-ia64: libunwind_ia64_la_SOURCES_ia64 = $(libunwind_la_SOURCES_ia64_common) \ @@ -200,7 +200,7 @@ libunwind_ia64_la_SOURCES_ia64 = $(libunwind_la_SOURCES_ia64_common) \ ia64/Gglobal.c ia64/Ginit.c ia64/Ginit_local.c ia64/Ginit_remote.c \ ia64/Ginstall_cursor.S ia64/Gis_signal_frame.c ia64/Gparser.c \ ia64/Grbs.c ia64/Gregs.c ia64/Gresume.c ia64/Gscript.c ia64/Gstep.c \ - ia64/Gtables.c ia64/Gfind_unwind_tables.c + ia64/Gtables.c ia64/Gfind_unwind_table.c # The list of files that go both into libunwind and libunwind-hppa: noinst_HEADERS += hppa/init.h hppa/offsets.h hppa/unwind_i.h diff --git a/src/ia64/Gfind_unwind_table.c b/src/ia64/Gfind_unwind_table.c index a871eecc..f7d31688 100644 --- a/src/ia64/Gfind_unwind_table.c +++ b/src/ia64/Gfind_unwind_table.c @@ -30,9 +30,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include "libunwind_i.h" - -#if UNW_TARGET_IA64 - #include "elf64.h" static unw_word_t diff --git a/src/ptrace/_UPT_find_proc_info.c b/src/ptrace/_UPT_find_proc_info.c index 2f477462..53dd1e7f 100644 --- a/src/ptrace/_UPT_find_proc_info.c +++ b/src/ptrace/_UPT_find_proc_info.c @@ -64,7 +64,7 @@ get_unwind_info (struct elf_dyn_info *edi, pid_t pid, unw_addr_space_t as, unw_w /* Here, SEGBASE is the starting-address of the (mmap'ped) segment which covers the IP we're looking for. */ - if (dwarf_find_unwind_table (edi, as, path, segbase, mapoff, ip) < 0) + if (tdep_find_unwind_table (edi, as, path, segbase, mapoff, ip) < 0) return -UNW_ENOINFO; /* This can happen in corner cases where dynamically generated diff --git a/src/ptrace/_UPT_get_dyn_info_list_addr.c b/src/ptrace/_UPT_get_dyn_info_list_addr.c index 60286aca..edc998fd 100644 --- a/src/ptrace/_UPT_get_dyn_info_list_addr.c +++ b/src/ptrace/_UPT_get_dyn_info_list_addr.c @@ -54,7 +54,7 @@ get_list_addr (unw_addr_space_t as, unw_word_t *dil_addr, void *arg, Debug (16, "checking object %s\n", path); - if (dwarf_find_unwind_table (&ui->edi, as, path, lo, off, 0) > 0) + if (tdep_find_unwind_table (&ui->edi, as, path, lo, off, 0) > 0) { res = _Uia64_find_dyn_list (as, &ui->edi.di_cache, arg); if (res && count++ == 0) diff --git a/tests/Makefile.am b/tests/Makefile.am index 26e79871..4b3bce38 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -165,3 +165,14 @@ test_setjmp_LDADD = $(LIBUNWIND_setjmp) ia64_test_setjmp_LDADD = $(LIBUNWIND_setjmp) test_coredump_unwind_LDADD = $(LIBUNWIND_coredump) $(LIBUNWIND) + +Gia64_test_nat_LDADD = $(LIBUNWIND) $(LIBUNWIND_local) +Gia64_test_stack_LDADD = $(LIBUNWIND) $(LIBUNWIND_local) +Gia64_test_rbs_LDADD = $(LIBUNWIND) $(LIBUNWIND_local) +Gia64_test_readonly_LDADD = $(LIBUNWIND) $(LIBUNWIND_local) +Lia64_test_nat_LDADD = $(LIBUNWIND_local) +Lia64_test_stack_LDADD = $(LIBUNWIND_local) +Lia64_test_rbs_LDADD = $(LIBUNWIND_local) +Lia64_test_readonly_LDADD = $(LIBUNWIND_local) +ia64_test_dyn1_LDADD = $(LIBUNWIND) +ia64_test_sig_LDADD = $(LIBUNWIND)