[RFC/WIP] unit test for separate debug info

Elena Zannoni ezannoni@redhat.com
Tue Nov 11 16:26:00 GMT 2003

Michael Elizabeth Chastain writes:
 > I gave it some proof-reading but did not try running it yet.
 > The idea looks okay to me.
 > For documentation, it would help to just have a list of files at the top:
 >   gdb.base/break            original executable
 >   gdb.base/break.stripped   stripped executable
 >   gdb.base/break.sym        debug symbols
 >   gdb.base/break.debuglink  output of --add-gnu-debuglink
 > (Hmmm, my list of files does not have any .debug directory!)
 > Human beings are good at reading examples and extrapolating
 > from them, and not as good at handling explicit meta-variables.

Indeed. The comments must be misleading, because the names of the
files you listed above are not the correct ones. So I'll add such a comment.
The files are

gdb.base/break-->original executable
gdb.base/break.stripped-->stripped exec
gdb.base/.debug/break.debug-->debuginfo only
gdb.base/break-->original exec minus debug symbols plus link to the .debug file

 > I would really like break.debuglink to be a separate file from the
 > original file.  If somebody is debugging this process, it's much better
 > to have each file be unique.

At first thought I'd say no, because that's not what you'll encounter
in practice. You would be testing something different. Close but
different. I.e. original executable name == name of final executable.
Indeed if you get a RedHat distro, you get all stripped binaries, but
their names are the usual ones.  However, on second thought it may work
anyway. I'll play with it.

 > In gdb_gnu_strip_debug, what are the final values of "strip_to_file_program"
 > and "objcopy_program" going to be?  I am hoping that they will just be
 >   set strip_to_file_program strip
 >   set objcopy_program       objcopy

yes. I had to tweak them in order to pick up the copies that had the
features, the ones installed on the systems were too old. Note the
failure mode as well. It produces an unsupported. For the RedHat case,
it would pick up eu-strip (but in reality the whole procedure is
different anyway).

 > Well, actually that works only for natives, crosses need more work.

yes. I am not planning on doing that right now. I guess I should make
the test work only for natives.

 > I would say, leave the elfutils case out for now.


 > Michael C

More information about the Gdb-patches mailing list