diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2007-09-01 08:16:16 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2007-09-01 08:16:16 +0000 |
commit | 4935890f4d4df7c5c88e4be2945e5c7a9b282ab6 (patch) | |
tree | 70802d509108611fa6e59db1531af4f0419f2f1c /gdb/testsuite/lib | |
parent | 399347457c16712c193406d56fe31287d2f2afa6 (diff) | |
download | fsf-binutils-gdb-4935890f4d4df7c5c88e4be2945e5c7a9b282ab6.zip fsf-binutils-gdb-4935890f4d4df7c5c88e4be2945e5c7a9b282ab6.tar.gz fsf-binutils-gdb-4935890f4d4df7c5c88e4be2945e5c7a9b282ab6.tar.bz2 |
* lib/gdb.exp (build_id_debug_filename_get): New function.
* gdb.base/sepdebug.exp: Reflect the changes in the heading comment.
Remove the generate DEBUG file for the future testcase runs.
New testcase for the NT_GNU_BUILD_ID retrieval.
Move the final testing step to ...
(test_different_dir): ... a new function.
New parameter XFAIL to XFAIL all the tests performed.
New parameter TEST_DIFFERENT_DIR parametrizing the directory.
New parameter TYPE to PF_PREFIX all the tests performed.
Diffstat (limited to 'gdb/testsuite/lib')
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index bfaf311..193a076 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -2482,6 +2482,27 @@ proc separate_debug_filename { exec } { return $debug_file } +# Return the build-id hex string (usually 160 bits as 40 hex characters) +# converted to the form: .build-id/ab/cdef1234...89.debug +# Return "" if no build-id found. +proc build_id_debug_filename_get { exec } { + set tmp "${exec}-tmp" + exec objcopy -j .note.gnu.build-id -O binary $exec $tmp + set fi [open $tmp] + # Skip the NOTE header. + read $fi 16 + set data [read $fi] + close $fi + file delete $tmp + if {$data eq ""} { + return "" + } + # Convert it to hex. + binary scan $data H* data + set data [regsub {^..} $data {\0/}] + return ".build-id/${data}.debug"; +} + # Create stripped files for DEST, replacing it. If ARGS is passed, it is a # list of optional flags. The only currently supported flag is no-main, # which removes the symbol entry for main from the separate debug file. |