libunwind-devel
[Top][All Lists]
Advanced

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

[Libunwind-devel] [PATCH 2/2] ARM: prefer to unwind using DWARF info


From: Ken Werner
Subject: [Libunwind-devel] [PATCH 2/2] ARM: prefer to unwind using DWARF info
Date: Mon, 29 Aug 2011 18:19:44 +0200

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 <address@hidden>
---
 src/arm/Gex_tables.c |   32 ++++++++++++++++----------------
 1 files changed, 16 insertions(+), 16 deletions(-)

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;
-- 
1.7.4.1




reply via email to

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