[Ltrace-devel] Getting prototypes from debug information

Mark Wielaard mjw at redhat.com
Thu Apr 10 09:41:50 UTC 2014


On Wed, 2014-04-09 at 19:03 -0700, Luca Clementi wrote:
> On Wed, Apr 9, 2014 at 3:50 PM, Dima Kogan <lists at dima.secretsauce.net> wrote:
> >
> > Petr Machata <pmachata at redhat.com> writes:
> >
> > > Dima Kogan <lists at dima.secretsauce.net> writes:
> > >
> > >> Currently it appears that all function prototypes are read from the
> > >> .conf files. Can these be read in from the debug information instead?
> > >
> > > They sure can.
> > >
> > >> ltrace already uses libdw, so I'm assuming either this is not possible,
> > >> or it's on somebody's short-term todo list. Any thoughts about it?
> > >
> > > It uses it optionally for unwinding, yes.  It could use it optionally
> > > for prototype retrieval as well.  This idea has crossed my mind in the
> > > past, and I wouldn't oppose patches that extend ltrace into accepting
> > > debuginfo if available.
> >
> > OK, I'll take a look. By the way, what was the issue with libunwind?
> > Isn't unwinding the whole point of that library?
> >
> 
> Few month ago Mark posted a patch to alternatively use elfutils to
> unwind the stack (instead of libunwind).
> They both do the same thing and share also a lot of code.
> 
> https://www.mail-archive.com/ltrace-devel@lists.alioth.debian.org/msg00731.html

Yes, there is nothing wrong with libunwind, the elfutils libdw unwinder
mostly is just an alternative right now.

But since libdw does know more about DWARF it can also provide more
functionality. The only added functionality over libunwind it currently
provides is displaying source files and lines in the backtrace. I
haven't really thought about any additional functionality that ltrace
could use when using libdw. But one thing might be sharing the function
symbol names since libdw can extract them from either the main
ELF .dynsym table, the possibly separate .debug full .symtab table or
the new .gnu_debugdata section if available. Another might indeed be
extracting and using more of the DWARF data. I am happy to help review
any suggested patches.

Cheers,

Mark




More information about the Ltrace-devel mailing list