diff mbox

[4/8] Prefer to unwind using DWARF info on ARM.

Message ID 1300895706-5424-5-git-send-email-ken.werner@linaro.org
State Accepted
Commit dcb8d0d90f74d8478c35ec5fee098e4348154818
Headers show

Commit Message

Ken Werner March 23, 2011, 3:55 p.m. UTC
DWARF expressions are more powerful than the ARM specific unwind tables.
Therefore DWARF should be the preferred unwind method.

Signed-off-by: Ken Werner <ken.werner@linaro.org>
---
 src/arm/Gstep.c |   23 +++++++++++++----------
 1 files changed, 13 insertions(+), 10 deletions(-)
diff mbox

Patch

diff --git a/src/arm/Gstep.c b/src/arm/Gstep.c
index 1b4b135..f036093 100644
--- a/src/arm/Gstep.c
+++ b/src/arm/Gstep.c
@@ -76,16 +76,7 @@  unw_step (unw_cursor_t *cursor)
 
   Debug (1, "(cursor=%p)\n", c);
 
-  if (UNW_TRY_METHOD (UNW_ARM_METHOD_EXIDX))
-    {
-      ret = arm_exidx_step (c);
-      if (ret >= 0)
-	return 1;
-      if (ret == -UNW_ESTOPUNWIND)
-	return 0;
-    }
-
-  /* Next, try DWARF-based unwinding. */
+  /* First, try DWARF-based unwinding. */
   if (UNW_TRY_METHOD(UNW_ARM_METHOD_DWARF))
     {
       ret = dwarf_step (&c->dwarf);
@@ -101,6 +92,18 @@  unw_step (unw_cursor_t *cursor)
       }
     }
 
+  /* Next, try extbl-based unwinding. */
+  if (UNW_TRY_METHOD (UNW_ARM_METHOD_EXIDX))
+    {
+      ret = arm_exidx_step (c);
+      if (ret >= 0)
+	return 1;
+      if (ret == -UNW_ESTOPUNWIND)
+	return 0;
+    }
+
+  /* Fall back on APCS frame parsing.
+     Note: This won't work in case the ARM EABI is used. */
   if (unlikely (ret < 0))
     {
       if (UNW_TRY_METHOD(UNW_ARM_METHOD_FRAME))