diff options
author | Tom de Vries <tdevries@suse.de> | 2019-09-29 23:58:21 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2019-09-29 23:58:21 +0200 |
commit | 0df0352ad0b64e884977d8251cf1b88b6640600f (patch) | |
tree | be678816da6274f8dc99685ca69ab9ee394d5f71 /gdb | |
parent | 73d9a918c6188ce0f1ec32e42dda063ca16e0362 (diff) | |
download | gdb-0df0352ad0b64e884977d8251cf1b88b6640600f.zip gdb-0df0352ad0b64e884977d8251cf1b88b6640600f.tar.gz gdb-0df0352ad0b64e884977d8251cf1b88b6640600f.tar.bz2 |
[gdb/contrib] cc-with-tweaks.sh: Create .dwz file in .tmp subdir
When running a test-case gdb.base/foo.exp with cc-with-dwz-m, a file
build/gdb/testsuite/outputs/gdb.base/foo/foo.dwz will be created, alongside
executable build/gdb/testsuite/outputs/gdb.base/foo/foo.
This can cause problems in f.i. test-cases that test file name completion.
Make these problems less likely by moving foo.dwz to a .tmp subdir:
build/gdb/testsuite/outputs/gdb.base/foo/.tmp/foo.dwz.
Tested on x86_64-linux.
gdb/ChangeLog:
2019-09-29 Tom de Vries <tdevries@suse.de>
* contrib/cc-with-tweaks.sh (get_tmpdir): New function.
Use $tmpdir/$(basename "$output_file").dwz instead of
"${output_file}.dwz".
gdb/testsuite/ChangeLog:
2019-09-29 Tom de Vries <tdevries@suse.de>
* gdb.dwarf2/gdb-index.exp: Handle new location of .dwz file.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rwxr-xr-x | gdb/contrib/cc-with-tweaks.sh | 16 | ||||
-rw-r--r-- | gdb/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.dwarf2/gdb-index.exp | 6 |
4 files changed, 26 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 99e4373..077b749 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2019-09-29 Tom de Vries <tdevries@suse.de> + + * contrib/cc-with-tweaks.sh (get_tmpdir): New function. + Use $tmpdir/$(basename "$output_file").dwz instead of + "${output_file}.dwz". + 2019-09-28 Simon Marchi <simon.marchi@polymtl.ca> PR gdb/25045 diff --git a/gdb/contrib/cc-with-tweaks.sh b/gdb/contrib/cc-with-tweaks.sh index 7df16bc..98c4f89 100755 --- a/gdb/contrib/cc-with-tweaks.sh +++ b/gdb/contrib/cc-with-tweaks.sh @@ -163,6 +163,12 @@ then exit 1 fi +get_tmpdir () +{ + tmpdir=$(dirname "$output_file")/.tmp + mkdir -p "$tmpdir" +} + if [ "$want_objcopy_compress" = true ]; then $OBJCOPY --compress-debug-sections "$output_file" rc=$? @@ -202,17 +208,19 @@ if [ "$want_dwz" = true ]; then ;; esac elif [ "$want_multi" = true ]; then + get_tmpdir + dwz_file=$tmpdir/$(basename "$output_file").dwz # Remove the dwz output file if it exists, so we don't mistake it for a # new file in case dwz fails. - rm -f "${output_file}.dwz" + rm -f "$dwz_file" cp $output_file ${output_file}.alt - $DWZ -m ${output_file}.dwz "$output_file" ${output_file}.alt > /dev/null + $DWZ -m "$dwz_file" "$output_file" ${output_file}.alt > /dev/null rm -f ${output_file}.alt # Validate dwz's work by checking if the expected output file exists. - if [ ! -f "${output_file}.dwz" ]; then - echo "$myname: dwz file ${output_file}.dwz missing." + if [ ! -f "$dwz_file" ]; then + echo "$myname: dwz file $dwz_file missing." exit 1 fi fi diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 3dec824..104303f 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2019-09-29 Tom de Vries <tdevries@suse.de> + * gdb.dwarf2/gdb-index.exp: Handle new location of .dwz file. + +2019-09-29 Tom de Vries <tdevries@suse.de> + * gdb.dwarf2/gdb-index.exp: Use with_test_prefix for second objcopy. 2019-09-27 Tom de Vries <tdevries@suse.de> diff --git a/gdb/testsuite/gdb.dwarf2/gdb-index.exp b/gdb/testsuite/gdb.dwarf2/gdb-index.exp index b14e07f..1fe993a 100644 --- a/gdb/testsuite/gdb.dwarf2/gdb-index.exp +++ b/gdb/testsuite/gdb.dwarf2/gdb-index.exp @@ -34,8 +34,10 @@ if { [prepare_for_testing "failed to prepare" "${testfile}" \ proc add_gdb_index { program } { set index_file ${program}.gdb-index - set dwz ${program}.dwz - set dwz_index_file ${dwz}.gdb-index + set dir [file dirname ${program}] + set filename [file tail ${program}] + set dwz $dir/.tmp/${filename}.dwz + set dwz_index_file $program.dwz.gdb-index verbose -log "index_file: ${index_file}" remote_file host delete ${index_file} remote_file host delete ${dwz_index_file} |