[gdb/testsuite] Compile varval twice, once without bad DWARF
authorTom de Vries <tdevries@suse.de>
Wed, 26 Jun 2019 13:04:05 +0000 (15:04 +0200)
committerTom de Vries <tdevries@suse.de>
Wed, 26 Jun 2019 13:04:05 +0000 (15:04 +0200)
commit8af58ffe5d06eaed8adfd1f0db2cb10d38c364e2
tree00db43961b2404ccc4e246113c8ab9dca5ff83ff
parent22e217527d1ba9ff3d933a14c9d81b066fac606d
[gdb/testsuite] Compile varval twice, once without bad DWARF

When we run gdb.dwarf2/varval.exp with board cc-with-dwz, we run into:
...
gdb compile failed, dwz: varval: Couldn't find DIE referenced by \
  DW_OP_GNU_variable_value
cc-with-tweaks.sh: dwz did not modify varval.
UNTESTED: gdb.dwarf2/varval.exp: failed to prepare
...

The problem is that varval contains some bad DWARF, which has been added
intentionally to test GDB, but that bad DWARF causes dwz to error out, which
has the consequence that the test-case remains untested with cc-with-dwz,
while the test-case contains also correct DWARF that does not occur in any
other test, and which we would really like to test with board cc-with-dwz.

Fix this by compiling varval twice, once without and once with the bad DWARF,
such that we have at least:
...
PASS: gdb.dwarf2/varval.exp: print varval
PASS: gdb.dwarf2/varval.exp: print varval2
PASS: gdb.dwarf2/varval.exp: print constval
PASS: gdb.dwarf2/varval.exp: print mixedval
PASS: gdb.dwarf2/varval.exp: print pointerval
PASS: gdb.dwarf2/varval.exp: print *pointerval
PASS: gdb.dwarf2/varval.exp: print structval
PASS: gdb.dwarf2/varval.exp: print untypedval
gdb compile failed, dwz: varval: Couldn't find DIE referenced by \
  DW_OP_GNU_variable_value
cc-with-tweaks.sh: dwz did not modify varval.
UNTESTED: gdb.dwarf2/varval.exp: failed to prepare
...

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2019-06-26  Tom de Vries  <tdevries@suse.de>

* gdb.dwarf2/varval.exp: Compile twice, once without bad DWARF.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.dwarf2/varval.exp