This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Stepping out of signal handler problem
- From: Aleksandar Ristovski <aristovski at qnx dot com>
- To: gdb at sources dot redhat dot com
- Date: Fri, 16 May 2008 12:26:43 -0400
- Subject: Stepping out of signal handler problem
Hello,
I have a problem with stepping out of signal handler (on Neutrino OS).
I am using sigstep (testsuite/gdb.base) test: When breakpoint is hit inside 'handler', and then doing step or stepi, gdb will not stop inside 'main'.
I have identified the problem, but do not know how to solve it.
The description of the problem:
After 'handler' returns to signal trampoline, we can properly identify context using current method (retrieving context pointer from EDI register) up to a point where our function restores EDI to state before signal (which is exactly the next stepi away). After this, until the sigreturn kernel call, the context is wrong.
The question 1: how should this (properly) be handled?
I tried to make a static var and keep context pointer until a non-sigtramp frame is identified, but that didn't work either, even with proper context gdb would still not 'land' into the main where it's supposed to, but rather behaves as if 'continue' was given.
This makes question 2: Is the only way to implement this similar to linux-nat (scanning for sigreturn kernel call)? Is there anything 'cleaner'?
Any hint would be appreciated.
Thanks,
Aleksandar Ristovski
QNX Software Systems