working with split debug files and sectionless ELFs

Mike Frysinger vapier@gentoo.org
Fri Oct 14 17:20:00 GMT 2011


On Friday 14 October 2011 11:49:24 Jan Kratochvil wrote:
> On Fri, 14 Oct 2011 17:38:30 +0200, Aleksandar Ristovski wrote:
> > On 11-10-14 11:27 AM, Mike Frysinger wrote:
> > > check out symfile.c:find_separate_debug_file_by_debuglink().  i hacked
> > > it locally so that when get_debug_link_info() returns NULL, the code
> > > would fall back to searching for the basename(argv[0]) + ".debug" of
> > > the ELF in question.  that seemed to do what i want: "just work".
> > 
> > Ok, so the problem is that if debuglink is missing, gdb just gives up.
> > 
> > FWIW, what you are proposing makes sense to me. Maybe make it an
> > optional behaviour?
> 
> The problem is the ".debug" extension is stored in .debug_link and it is
> not assumed by GDB so far.  And for example Debian does not use it at all.

that's why it was a hack.  i think it reasonable that if there is no debug 
info to first look for the file name itself, and then look for the file name with 
a .debug suffix.

so `gdb prog` where prog is found at /usr/bin/prog would default to 
/usr/lib/debug/usr/bin/prog followed by /usr/lib/debug/usr/bin/prog.debug (and 
obviously /usr/lib/debug/ is the existing configurable setup and not a 
hardcoded path).

i'm thinking of the fallback/default behavior here.  none of this would 
preclude the existing explicit options that gdb has available.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://sourceware.org/pipermail/gdb/attachments/20111014/dff1703e/attachment.sig>


More information about the Gdb mailing list