[gdb/testsuite] Fix gdb.dwarf2/fission-reread.exp with .gdb_index
authorTom de Vries <tdevries@suse.de>
Mon, 1 Feb 2021 17:24:49 +0000 (18:24 +0100)
committerTom de Vries <tdevries@suse.de>
Mon, 1 Feb 2021 17:24:49 +0000 (18:24 +0100)
commitc39c86378fca7ea4cf8b5766e5b317e55d3d6e72
treec2b5b92868bbee2eca41335f4735165c594de478
parent34c10233cd204fe5ccafde590294fe20978cb7fa
[gdb/testsuite] Fix gdb.dwarf2/fission-reread.exp with .gdb_index

When running test-case gdb.dwarf2/fission-reread.exp with target board
cc-with-gdb-index, we run into:
...
gdb compile failed, warning: Could not find DWO TU \
  fission-reread.dwo(0x9022f1ceac7e8b19) referenced by TU at offset 0x0 \
  [in module outputs/gdb.dwarf2/fission-reread/fission-reread]
...
The problem is that the .dwo file is not found.

There's code added in the .exp file to make sure the .dwo can be found:
...
 # Make sure we can find the .dwo file, regardless of whether we're
 # running in parallel mode.
 gdb_test_no_output "set debug-file-directory [file dirname $binfile]" \
     "set debug-file-directory"
...
This works normally, but not for the gdb invocation done by cc-with-tweaks.sh
for target board cc-with-gdb-index.

Fix this by finding the full path to the .dwo file and passing it
to the compilation.

Tested on x86_64-linux with native and target boards cc-with-gdb-index,
cc-with-debug-names and readnow.

gdb/testsuite/ChangeLog:

2021-02-01  Tom de Vries  <tdevries@suse.de>

* gdb.dwarf2/fission-base.S: Pass -DDWO=$dwo.
* gdb.dwarf2/fission-loclists-pie.S: Same.
* gdb.dwarf2/fission-loclists.S: Same.
* gdb.dwarf2/fission-multi-cu.S: Same.
* gdb.dwarf2/fission-reread.S: Same.
* gdb.dwarf2/fission-base.exp: Use DWO.
* gdb.dwarf2/fission-loclists-pie.exp: Same.
* gdb.dwarf2/fission-loclists.exp: Same.
* gdb.dwarf2/fission-multi-cu.exp: Same.
* gdb.dwarf2/fission-reread.exp: Same.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.dwarf2/fission-base.S
gdb/testsuite/gdb.dwarf2/fission-base.exp
gdb/testsuite/gdb.dwarf2/fission-loclists-pie.S
gdb/testsuite/gdb.dwarf2/fission-loclists-pie.exp
gdb/testsuite/gdb.dwarf2/fission-loclists.S
gdb/testsuite/gdb.dwarf2/fission-loclists.exp
gdb/testsuite/gdb.dwarf2/fission-multi-cu.S
gdb/testsuite/gdb.dwarf2/fission-multi-cu.exp
gdb/testsuite/gdb.dwarf2/fission-reread.S
gdb/testsuite/gdb.dwarf2/fission-reread.exp