On Wed, Apr 4, 2012 at 8:45 PM, Arun Sharma <[email protected]> wrote:

> If you want all of this to work without -fno-omit-frame-pointer,
> things become a bit more complicated. We'll somehow have to
> (heuristically?) unwind up to the point where IP is valid. libunwind
> knows what to do after that.

Here's one way to make it work:

In the signal handler, you can compare the faulting address to %rip
and infer that this was a SIGSEGV caused by a bad function pointer.
Then you can special case this (i.e.  unwind the inner most frame
"manually" -- by changing %rip in the  ucontext to the return address
pointed to by %rsp). libunwind should be able to do the rest of the
work for you.

Why not have this code inside of libunwind? The interfaces do so would
be icky and this is best done in the signal handler, rather than
another library.

 -Arun

_______________________________________________
Libunwind-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/libunwind-devel

Reply via email to