From 92327a3647a96e6425c158cd0f9ec2669c441647 Mon Sep 17 00:00:00 2001 From: Ken Werner Date: Mon, 29 Aug 2011 14:36:27 +0000 Subject: [PATCH] ARM: prefer to unwind using DWARF info In case the user doesn't specify whether to unwind using the ARM specific unwind tabler or DWARF info libunwind should prefer the latter. Since DWARF expressions are more powerful than the ARM specific unwind tables arm_find_proc_info is changed to check for DWARF first. Signed-off-by: Ken Werner --- src/arm/Gex_tables.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/arm/Gex_tables.c b/src/arm/Gex_tables.c index 5d8c0f45..70ab57cf 100644 --- a/src/arm/Gex_tables.c +++ b/src/arm/Gex_tables.c @@ -507,27 +507,7 @@ arm_find_proc_info (unw_addr_space_t as, unw_word_t ip, Debug (14, "looking for IP=0x%lx\n", (long) ip); - if (UNW_TRY_METHOD (UNW_ARM_METHOD_EXIDX)) - { - struct arm_cb_data cb_data; - - memset (&cb_data, 0, sizeof (cb_data)); - cb_data.ip = ip; - cb_data.pi = pi; - cb_data.di.format = -1; - - SIGPROCMASK (SIG_SETMASK, &unwi_full_mask, &saved_mask); - ret = dl_iterate_phdr (arm_phdr_cb, &cb_data); - SIGPROCMASK (SIG_SETMASK, &saved_mask, NULL); - - if (cb_data.di.format != -1) - ret = tdep_search_unwind_table (as, ip, &cb_data.di, pi, - need_unwind_info, arg); - else - ret = -UNW_ENOINFO; - } - - if (ret < 0 && UNW_TRY_METHOD(UNW_ARM_METHOD_DWARF)) + if (UNW_TRY_METHOD(UNW_ARM_METHOD_DWARF)) { struct dwarf_callback_data cb_data; @@ -553,6 +533,26 @@ arm_find_proc_info (unw_addr_space_t as, unw_word_t ip, ret = -UNW_ENOINFO; } + if (ret < 0 && UNW_TRY_METHOD (UNW_ARM_METHOD_EXIDX)) + { + struct arm_cb_data cb_data; + + memset (&cb_data, 0, sizeof (cb_data)); + cb_data.ip = ip; + cb_data.pi = pi; + cb_data.di.format = -1; + + SIGPROCMASK (SIG_SETMASK, &unwi_full_mask, &saved_mask); + ret = dl_iterate_phdr (arm_phdr_cb, &cb_data); + SIGPROCMASK (SIG_SETMASK, &saved_mask, NULL); + + if (cb_data.di.format != -1) + ret = tdep_search_unwind_table (as, ip, &cb_data.di, pi, + need_unwind_info, arg); + else + ret = -UNW_ENOINFO; + } + if (ret < 0) Debug (14, "IP=0x%lx not found\n", (long) ip);