Closed lks9 closed 7 months ago
"Add the signal number to the trace when calling an interrupt handler function" can never be implemented because of race condition. This would not be "signal safe" as this is called in the unix jargon.
The only thing we could do is to add the signal number to a separate trace file. So the trace of the interrupt handler function would be separate. This would require to pause the tracing, call _TRACE_OPEN in the interrupt handler function and before finishing call _TRACE_CLOSE and resume the original tracing. It is possible to implement it that way! Retracing would be very hard, and I could imagine that it is only possible to retrace parts of it.
Anyway, setjmp/longjmp works and it is clear that it is not clear how to solve the signals part. So I am closing this issue.
Workarounds for signal/interrupt handler treatment:
_TRACE_OPEN()
and _TRACE_CLOSE()
in the signal handler only. Since some time, such instrumentation is possible with instrumenter.py --record SIGNAL_HANDLER
where SIGNAL_HANDLER
is the name of the signal handler function. The main
function will no longer be recorded then. Retracing the signal handler (only) should work as desired.
An interruption (by a signal) might occur anywhere.
With
setjmp()
is specified as a nonlocal jump target (#57).