Make sure that the `sigcontext_addr' cursor member is pointing to the
`struct sigcontext' as expected in arm_local_resume().
---
 src/arm/Gstep.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/arm/Gstep.c b/src/arm/Gstep.c
index 3b7bdbe..b96d5e2 100644
--- a/src/arm/Gstep.c
+++ b/src/arm/Gstep.c
@@ -1,6 +1,7 @@
 /* libunwind - a platform-independent unwind library
    Copyright (C) 2008 CodeSourcery
    Copyright 2011 Linaro Limited
+   Copyright (C) 2012 Tommi Rantala <[email protected]>
 
 This file is part of libunwind.
 
@@ -111,7 +112,6 @@ unw_handle_signal_frame (unw_cursor_t *cursor)
          c->sigcontext_format = ARM_SCF_LINUX_OLD_SIGFRAME;
          sc_addr = sp_addr;
        }
-      c->sigcontext_addr = sp_addr;
     }
   else if (ret == 2)
     {
@@ -120,18 +120,19 @@ unw_handle_signal_frame (unw_cursor_t *cursor)
       if (sp == sp_addr + 8)
        {
          c->sigcontext_format = ARM_SCF_LINUX_OLD_RT_SIGFRAME;
-         c->sigcontext_addr = sp_addr + 8 + sizeof (siginfo_t); 
+         sc_addr = sp_addr + 8 + sizeof (siginfo_t) + LINUX_UC_MCONTEXT_OFF;
        }
       else
        {
          c->sigcontext_format = ARM_SCF_LINUX_RT_SIGFRAME;
-         c->sigcontext_addr = sp_addr + sizeof (siginfo_t);
+         sc_addr = sp_addr + sizeof (siginfo_t) + LINUX_UC_MCONTEXT_OFF;
        }
-      sc_addr = c->sigcontext_addr + LINUX_UC_MCONTEXT_OFF;
     }
   else
     return -UNW_EUNSPEC;
 
+  c->sigcontext_addr = sc_addr;
+
   /* Update the dwarf cursor.
      Set the location of the registers to the corresponding addresses of the
      uc_mcontext / sigcontext structure contents.  */
-- 
1.7.9.5


_______________________________________________
Libunwind-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/libunwind-devel

Reply via email to