This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils 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: Using dwfl to enumerate frames of current thread


Mark Wielaard <mjw@redhat.com> writes:

> On Thu, 2015-08-20 at 13:09 +0200, Ben Gamari wrote:
>> It turns out that libbacktrace only uses DWARF line information, not
>> the .debug_frames unwinding information.
>
> It might indeed be that libbacktrace only handles .eh_frame.
> If you already generate .debug_frame it should be easy to
> generate .eh_frame information. The formats are almost the same with a
> few small encoding differences (also .eh_frame can have a .eh_frame_hdr
> index which makes address lookup and unwinding much more efficient).
> http://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/ehframechpt.html
> http://www.airs.com/blog/archives/460
>
> Alternatively it might not be too hard to make libbacktrace
> use .debug_frame if it is already loading the .debug_line info then
> making it also load .debug_frame and interpret it mostly like .eh_frame
> is. (elfutils libdw cie.c/fde.c use CFI_IS_EH to distinquish if you want
> to see some of the practical differences)
>
> Again, not wanting you to push away towards another library, but simply
> pointing out different options.
>
Thanks!

The other consideration that is pushing me towards elfutils is the fact
that we may very well end up needing the flexibility that it offers. For
instance, I suspect we can unwind the GHC stack more efficiently (and
perhaps more easily) that the DWARF unwinder by implementing the
unwinding explicitly in the runtime system (in fact, this is already
implemented).

In order for this to be possible, however, we need the ability to look
up symbol and line information from arbitrary addresses. Unfortunately
both libbacktrace and libunwind lack this and other low-level
interfaces.

They are both very convenient (and, for this reason, tempting) but so
far my attempts at using them have consistently ended in my needing
something which their interfaces don't provide.

Cheers,

- Ben

Attachment: signature.asc
Description: PGP signature


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