diff mbox

[2/2] ARM: prefer to unwind using DWARF info

Message ID 1314634784-7847-3-git-send-email-ken.werner@linaro.org
State Accepted
Commit 92327a3647a96e6425c158cd0f9ec2669c441647
Headers show

Commit Message

Ken Werner Aug. 29, 2011, 4:19 p.m. UTC
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 <ken.werner@linaro.org>
---
 src/arm/Gex_tables.c |   32 ++++++++++++++++----------------
 1 files changed, 16 insertions(+), 16 deletions(-)
diff mbox

Patch

diff --git a/src/arm/Gex_tables.c b/src/arm/Gex_tables.c
index 5d8c0f4..70ab57c 100644
--- a/src/arm/Gex_tables.c
+++ b/src/arm/Gex_tables.c
@@ -507,47 +507,47 @@  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))
+  if (UNW_TRY_METHOD(UNW_ARM_METHOD_DWARF))
     {
-      struct arm_cb_data cb_data;
+      struct dwarf_callback_data cb_data;
 
       memset (&cb_data, 0, sizeof (cb_data));
       cb_data.ip = ip;
       cb_data.pi = pi;
+      cb_data.need_unwind_info = need_unwind_info;
       cb_data.di.format = -1;
+      cb_data.di_debug.format = -1;
 
       SIGPROCMASK (SIG_SETMASK, &unwi_full_mask, &saved_mask);
-      ret = dl_iterate_phdr (arm_phdr_cb, &cb_data);
+      ret = dl_iterate_phdr (dwarf_callback, &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,
+      if (cb_data.single_fde)
+	/* already got the result in *pi */
+	return 0;
+
+      if (cb_data.di_debug.format != -1)
+	ret = tdep_search_unwind_table (as, ip, &cb_data.di_debug, pi,
 					need_unwind_info, arg);
       else
 	ret = -UNW_ENOINFO;
     }
 
-  if (ret < 0 && UNW_TRY_METHOD(UNW_ARM_METHOD_DWARF))
+  if (ret < 0 && UNW_TRY_METHOD (UNW_ARM_METHOD_EXIDX))
     {
-      struct dwarf_callback_data cb_data;
+      struct arm_cb_data cb_data;
 
       memset (&cb_data, 0, sizeof (cb_data));
       cb_data.ip = ip;
       cb_data.pi = pi;
-      cb_data.need_unwind_info = need_unwind_info;
       cb_data.di.format = -1;
-      cb_data.di_debug.format = -1;
 
       SIGPROCMASK (SIG_SETMASK, &unwi_full_mask, &saved_mask);
-      ret = dl_iterate_phdr (dwarf_callback, &cb_data);
+      ret = dl_iterate_phdr (arm_phdr_cb, &cb_data);
       SIGPROCMASK (SIG_SETMASK, &saved_mask, NULL);
 
-      if (cb_data.single_fde)
-	/* already got the result in *pi */
-	return 0;
-
-      if (cb_data.di_debug.format != -1)
-	ret = tdep_search_unwind_table (as, ip, &cb_data.di_debug, pi,
+      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;