working with split debug files and sectionless ELFs

Mike Frysinger vapier@gentoo.org
Wed Oct 12 17:36:00 GMT 2011


i've been playing around with super stripping ELFs to the point where they no 
longer have ELF sections (since they're not used at runtime).  all of this 
info has been preserved though in the split debug file.  eu-strip makes this 
very easy to pull off:
	eu-strip /usr/bin/prog --strip-sections \
		-f /usr/lib/debug/usr/bin/prog.debug

first, it seems that --symbols silently conflicts with specifying binaries on 
the command line.  so if i do:
	gdb prog --symbols=/usr/lib/debug/usr/bin/prog.debug
the --symbols argument is silently ignored and gdb complains about no 
debugging information found.  if however i do:
	gdb --symbols=/usr/lib/debug/usr/bin/prog.debug --exec=/usr/bin/prog
then everything works nicely.  i can imagine that people aren't keen on 
changing this behavior so it works (imo) a bit more naturally, but should we 
at least have gdb warn that --symbols is ignored when given an executable on 
the command line ?  the --help output doesn't seem to mention this that i can 
see.

second, i wonder if we can't have this work more intelligently out of the box.  
is it unreasonable to have gdb automatically search /usr/lib/debug/ for split 
debuf files if the .gnu_debuglink section does not exist ?  or at least do it 
if the ELF has no sections at all ?  it'd be nice if we could do `gdb prog` 
and gdb is smart enough to at least check /usr/lib/debug/usr/bin/prog.debug.
-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/20111012/3801747f/attachment.sig>


More information about the Gdb mailing list