[gdb/contrib] cc-with-tweaks.sh: Create .dwz file in .tmp subdir
authorTom de Vries <tdevries@suse.de>
Sun, 29 Sep 2019 21:58:21 +0000 (23:58 +0200)
committerTom de Vries <tdevries@suse.de>
Sun, 29 Sep 2019 21:58:21 +0000 (23:58 +0200)
commit0df0352ad0b64e884977d8251cf1b88b6640600f
treebe678816da6274f8dc99685ca69ab9ee394d5f71
parent73d9a918c6188ce0f1ec32e42dda063ca16e0362
[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.
gdb/ChangeLog
gdb/contrib/cc-with-tweaks.sh
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.dwarf2/gdb-index.exp