[PTLsim-devel] Handling signals
Stephan Diestelhorst
Fri Jul 20 11:24:16 EDT 2007
Hello again,
another thing that I stumbled upon recently:
How does PTLsim handle signals / exceptions generated inside the simulated
programme? I had hoped that I might intercept them at some point, but as it
seems to me right now, they seem to crash PTLsim everytime.
I tried to extend kernel.cpp:init_signal_callback and the according
handler 'external_signal_callback', so that it would print out a message when
receiving a signal.
However, sending a signal to neither `pidof testprog` nor `pidof ptlsim`
caused the invocation of that handler, but crashed the simulator, w/o any
output.
I then tried to handle the signal inside the test-prog, by simply
calling 'signal(SIGUSR1, my_&handler);' which gives the expected results,
when the programm is run natively. But again, the handler was not invoked,
when I sent signals to the programme being simulated by PTLsim.
This is fairly annoying, as code might want to catch some of its exceptions,
such as arithmetic error (e.g. divide by zero).
Am I missing something? Or this this generally a limitation of PTLsim-classic?
Thankful for any pointers!
Thanks,
Stephan
--
Stephan Diestelhorst, AMD Operating System Research Center
stephan.diestelhorst at amd.com, Tel. (AMD: 8-4903)
More information about the PTLsim-devel mailing list