This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ARM Linux EABI: unwinding through a segfault handler


A shiny revised version of my unwind-through-signal code for ARM EABI:

https://github.com/mvduin/arm-signal-unwind/

For actual unwinding it now uses sigreturn as a cleanup handler (after
diddling the ucontext to make it land right onto a call to
_Unwind_Resume), which means that all state should get properly
restored by the kernel.

Virtual unwinding still only restores core registers, but hopefully
that isn't too big a problem in practice.

A small test is included that confirms throwing exceptions out of
SEGV, checks VFP is restored properly, and that returning normally
from an async signal handler still works (my original patch accidently
broke that).

I'd finally like to take a moment to say this was hell to figure
out.... this shit is really documented nowhere properly since it
appears to be a magic blend of ARM EABI and IA64 C++ ABI (meaning
neither documentation quite applies) and I had to plow through the
innards of libgcc and libsupc++ to figure out how things *actually*
work. Argh.

Anyhow, it only took four years, but you can now throw
NullPointerExceptions on ARM. Enjoy. ;-)

Matthijs van Duin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]