Stepping out of signal handler problem

Aleksandar Ristovski aristovski@qnx.com
Fri May 16 16:27:00 GMT 2008


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



More information about the Gdb mailing list