diff options
author | Andrew Burgess <aburgess@redhat.com> | 2024-05-18 11:05:49 +0100 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2024-06-04 13:33:31 +0100 |
commit | 9543c37620c9483f77f0f728f32e6517987c7b4c (patch) | |
tree | 142a8303af92578d7fdea9dbfc44820284f29fab /zlib/ChangeLog | |
parent | 92a89ee1d99c200adb13728b549222d71b6349ad (diff) | |
download | gdb-9543c37620c9483f77f0f728f32e6517987c7b4c.zip gdb-9543c37620c9483f77f0f728f32e6517987c7b4c.tar.gz gdb-9543c37620c9483f77f0f728f32e6517987c7b4c.tar.bz2 |
gdb/testsuite: make gdb_gnu_strip_debug consistent
While writing a test I realised that the default behaviour of
gdb_gnu_strip_debug doesn't match its comment.
The comment says that the function takes a FILENAME, and splits the
file into FILENAME.stripped and FILENAME.debug, leaving FILENAME
unchanged. The comment says that a .gnu_debuglink will be added to
FILENAME.stripped.
However, this is not true, FILENAME.stripped is created, with no debug
information. FILENAME.debug is created containing the debug
information.
But, when adding the .gnu_debuglink we take FILENAME.stripped as the
input, and then overwrite FILENAME with the output. As a result,
FILENAME.stripped does not include a .gnu_debuglink, while FILENAME
contains the .gnu_debuglink and no debug information!
The users of gdb_gnu_strip_debug can be split into two groups, those
who are using the .gnu_debuglink, these tests are all written assuming
that FILENAME is updated.
Then there are some tests that only rely on gdb_gnu_strip_debug's
ability to split out the debug information, these tests are then going
to do a lookup based on the build-id, these tests don't require the
.gnu_debuglink. These tests use the FILENAME.stripped output file.
This all seems too confused to me.
As most uses of gdb_gnu_strip_debug assume that FILENAME is updated, I
propose that we just make that the actual, advertised behaviour of
this proc.
So now, gdb_gnu_strip_debug will take FILENAME, and will split the
debug information out into FILENAME.debug. The debug information will
then be stripped from FILENAME, and by default a .gnu_debuglink will
be added to FILENAME pointing to FILENAME.debug.
I've updated the two tests that actually relied on FILENAME.stripped
to instead just use FILENAME.
One of the tests was doing a build-id based lookup, but was still
allowing the .gnu_debuglink to be added to FILENAME, I've updated this
test to pass the no-debuglink flag to gdb_gnu_strip_debug, which stops
the .gnu_debuglink from being added.
All of the tests that call gdb_gnu_strip_debug still pass for me.
Acked-By: Tom de Vries <tdevries@suse.de>
Diffstat (limited to 'zlib/ChangeLog')
0 files changed, 0 insertions, 0 deletions