https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67365

--- Comment #3 from Ian Lance Taylor <ian at airs dot com> ---
The missing address is part of the signal handling code.  It's the code that
returns to normal execution after the signal handler completes, by calling the
rt_sigreturn system call.  The backtrace code routinely decrements the return
address by 1, so that it can report the file/line of the function call rather
than the line that follows the call.  In this case, decrementing by 1 gives it
an address 1 byte before _restore_rt.  It can't find any file/line information
for that one byte, so you get a ???.

This code is very processor-specific.  GCC's internal unwind library knows that
we are looking at a signal handler return, but it doesn't expose the
information in any way that I can see (the _Unwind_IsSignalFrame function
returns true for the function in which the signal occurred, which is the frame
above the frame we are talking about).

I think the best fix is going to be to add a new flag to _Unwind_Context:
SIGRETURN_BIT or something, to indicate that the current context is a signal
handler frame.  Then we can add an _Unwind_IsSigreturn function so that the
unwind code can check that bit.  Then libbacktrace can return something like
<signal handler> as gdb does.  (gdb currently uses processor-specific code for
this.)

Reply via email to