On Wed, Mar 12, 2014 at 8:33 AM, Peng Yuan <yingbo....@gmail.com> wrote:
>
> I'm using backtrace() to obtain call context by sending signals. But
> program segfaults if the first instruction of a function receives
> signal for backtrace.
>
> ARM unwinding in libgcc uses "return_address -= 2" to get the caller
> address. It is OK for normal function call with "bl xxx". But it
> cannot handle signal frame case because "return_address -= 2" may go
> to the preceding function.
> See get_eit_entry() in libgcc/unwind-arm-common.inc.
>
> Both GDB and libunwind take signal frame as a special case on ARM
> unwinding.  Does libgcc also need to fix the case?

Note that the default libgcc unwinder does support special handling of
signal frames.  See _Unwind_IsSignalFrame and _Unwind_SetSignalFrame
and the signal_frame field of _Unwind_FrameState.  The signal_frame is
set by, for example, x86_64_fallback_frame_state in
gcc/config/linux/linux-unwind.h.

So clearly something similar can be done for ARM.  My understanding is
that the ARM EABI specifies the unwind info.  I don't know how that
would affect this idea.

Ian

Reply via email to