[PATCH 4/5] Support backtracing through elfutils (#70746)

Mark Wielaard mjw at redhat.com
Wed Oct 30 19:50:28 CET 2013


On Wed, 2013-10-30 at 12:14 +0100, Jan Kratochvil wrote:
> On Wed, 30 Oct 2013 11:02:25 +0100, Mark Wielaard wrote:
> > I would love to promote elfutils for that. But you could just
> > use backtrace () and backtrace_symbols () if the C library provides them.
> 
> It is unfortunately not so easy, I wrote there lower in the mail:
> 
> > On Wed, 30 Oct 2013 08:58:00 +0100, Jan Kratochvil wrote:
> > > libgcc backtrace_symbols() can do some "addr->elfsymbol" but it resolves only
> > > symbols in .dynsym (exported ones), not from .symtab, therefore also not from
> > > separate .debug files.

I see. And I now looked a bit more at the actual os/backtrace.c code.
The code already uses dladdr () which provides the same (limited) info.

It also looks like this might be called from OsSigHandler to handle a
fatal signal. In that case you really should do the minimum possible and
get out quickly.

Do you really want to do anything more than direct (.dynsym) symbol
lookup? Looking up and loading separate .debug files or decompressing
a .gnu_debugdata section for example to get more interesting tables with
symbol names might not be the best thing to do from a signal handler
through any of the proposed libraries.

Cheers,

Mark



More information about the xorg-devel mailing list