libunwind-devel
[Top][All Lists]
Advanced

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

[Libunwind-devel] [PATCH 6/6] Fixes for interation end conditions of non


From: Konstantin Belousov
Subject: [Libunwind-devel] [PATCH 6/6] Fixes for interation end conditions of non-dwarf walker on x86_64.
Date: Mon, 23 Apr 2012 13:29:02 +0300

In the commit d04dc94cc2b0141f06ed9de1665ab89a3f549e0b, the check for
dwarf.ip == 0 was removed from non-dwarf walker in x86_64 version of
unw_step(). Apparently this broke the detection of the end of frame
chain when NULL %rbp is specified, because the case just marked
dwarf.ip as 0. Explicitely set ret to 0 to indicate the end of
iteration.

Similarly, if dwarf_get() reading of %rip succeeds for non-dward walker,
reset the ret to 1. The success value of 0 stops the iteration.
---
 src/x86_64/Gstep.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/x86_64/Gstep.c b/src/x86_64/Gstep.c
index 5ecee26..e05fcae 100644
--- a/src/x86_64/Gstep.c
+++ b/src/x86_64/Gstep.c
@@ -85,7 +85,10 @@ unw_step (unw_cursor_t *cursor)
       /* x86_64 ABI specifies that end of call-chain is marked with a
         NULL RBP.  */
       if (DWARF_IS_NULL_LOC (c->dwarf.loc[RBP]))
-       c->dwarf.ip = 0;
+       {
+         c->dwarf.ip = 0;
+         ret = 0;
+       }
     }
   else
     {
@@ -206,6 +209,7 @@ unw_step (unw_cursor_t *cursor)
              Debug (2, "returning %d\n", ret);
              return ret;
            }
+         ret = 1;
        }
       else
        c->dwarf.ip = 0;
-- 
1.7.9.6




reply via email to

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