From 5738bac1717a0b315c5181400a3de1873e012df7 Mon Sep 17 00:00:00 2001 From: Tommi Rantala Date: Fri, 10 Aug 2012 11:39:17 +0300 Subject: [PATCH] ARM: fix with-signal-frame local unw_resume() 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 3b7bdbe8..b96d5e2b 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 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. */