|
From: | Johan Walles |
Subject: | Re: [libunwind] Unwinding using the context passed to a signal handler (doesn't work) |
Date: | Thu, 18 Mar 2004 15:46:37 +0100 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 |
David Mosberger wrote:
unw_getcontext() returns the _preserved_ state in ucontext_t, whereas a signal handler saves only the _scratch_ state in sigcontext. To initiate unwinding, the preserved state is needed.
Which registers exactly are missing from the sigcontext passed to the signal handler?
I was guessing that the only thing needed to walk the stack would be the IP, BSP, SP (=R12), and the CFM. Aren't those part of the signal context?
You should be able to just do a unw_getcontext() anywhere in the signal handler and then step until you hit the signal frame (as indicated by unw_is_signal_frame()).
I'd prefer just filling in a few more registers in the sigcontext struct. Can we do that? Which registers would that be?
//Johan
[Prev in Thread] | Current Thread | [Next in Thread] |