diff mbox

[2/2] ARM: Ensure unw_step returns whatever find_proc_info() returns

Message ID 1313592083-2817-3-git-send-email-ken.werner@linaro.org
State Accepted
Commit 112c927371b8253040a38da697372a3fd67ad520
Headers show

Commit Message

Ken Werner Aug. 17, 2011, 2:41 p.m. UTC
This allows the test-proc-info test case to pass on ARM.

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

Patch

diff --git a/src/arm/Gstep.c b/src/arm/Gstep.c
index 270058b..1dae78e 100644
--- a/src/arm/Gstep.c
+++ b/src/arm/Gstep.c
@@ -45,13 +45,15 @@  arm_exidx_step (struct cursor *c)
   c->dwarf.loc[UNW_ARM_R15] = DWARF_NULL_LOC;
 
   if ((ret = tdep_find_proc_info (&c->dwarf, c->dwarf.ip, 1)) < 0)
-     return -UNW_ENOINFO;
+     return ret;
 
   if (c->dwarf.pi.format != UNW_INFO_FORMAT_ARM_EXIDX)
     return -UNW_ENOINFO;
 
   ret = arm_exidx_extract (&c->dwarf, buf);
-  if (ret < 0)
+  if (ret == -UNW_ESTOPUNWIND)
+    return 0;
+  else if (ret < 0)
     return ret;
 
   ret = arm_exidx_decode (buf, ret, &c->dwarf);
@@ -189,10 +191,10 @@  unw_step (unw_cursor_t *cursor)
   if (UNW_TRY_METHOD (UNW_ARM_METHOD_EXIDX))
     {
       ret = arm_exidx_step (c);
-      if (ret >= 0)
+      if (ret > 0)
 	return 1;
-      if (ret == -UNW_ESTOPUNWIND)
-	return 0;
+      if (ret == -UNW_ESTOPUNWIND || ret == 0)
+	return ret;
     }
 
   /* Fall back on APCS frame parsing.