[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFxqXzdszuYwnFJwX0RRuPtqedhv-hQhQjyM_iL6Stm07g@mail.gmail.com>
Date: Fri, 16 Sep 2016 19:31:24 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Josh Poimboeuf <jpoimboe@...hat.com>
Cc: Peter Zijlstra <peterz@...radead.org>,
Stephane Eranian <eranian@...gle.com>,
Vince Weaver <vincent.weaver@...ne.edu>,
LKML <linux-kernel@...r.kernel.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Ingo Molnar <mingo@...nel.org>,
Kees Cook <keescook@...omium.org>
Subject: Re: [PATCH v2] scripts: add script for translating stack dump
function offsets
On Fri, Sep 16, 2016 at 6:59 PM, Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
>
> And finally, I suspect (5) is not reasonably fixable. Oh well. It
> would require some kind of "figure out the largest common prefix of
> all the filenames in the whole object file". So I'm *not* talking
> about just passing "--basenames" to addr2line.
>
> Hmm. Maybe looking up the "DW_AT_comp_dir" tag in the debug info would
> work? And just stripping that off?
Thinking more about this, that actually sounds like it might be the
right thing to do.
It doesn't work for most projects, but the way the kernel build system
is set up, we don't actually recursively descend into subdirectories,
we always build at the top level. So DW_AT_comp_dir should always (?)
be the actual top-level build directory, and we could just scrape that
off from the addr2line output.
That said, I don't even know what the "real" way to dump the debug
symbol data is. I do *not* believe that you should use
readelf -W --debug-dump vmlinux | grep DW_AT_comp_dir | head -1
to get the information. There is bound to be something much better.
Somebody who knows the ELF tools can now pipe in and show the world
what a maroon I am.
Linus
Powered by blists - more mailing lists