[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Libunwind-devel] Libunwind support for NULL IP
From: |
Arun Sharma |
Subject: |
Re: [Libunwind-devel] Libunwind support for NULL IP |
Date: |
Thu, 5 Apr 2012 09:04:10 -0700 |
On Wed, Apr 4, 2012 at 8:45 PM, Arun Sharma <address@hidden> 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