[gdb/testsuite] Fix gdb.base/gold-gdb-index.exp
authorTom de Vries <tdevries@suse.de>
Wed, 14 Jul 2021 09:46:50 +0000 (11:46 +0200)
committerTom de Vries <tdevries@suse.de>
Wed, 14 Jul 2021 09:46:50 +0000 (11:46 +0200)
commit26e27615ab230cf88c6c10909336eab4622925b6
treeb1d9c6d9d8a6af8c5eaf5417db50160b3a84a83c
parent7d11b094f404b3a89554e4a7554a493e296bac88
[gdb/testsuite] Fix gdb.base/gold-gdb-index.exp

When running test-case gdb.base/gold-gdb-index.exp on openSUSE Tumbleweed,
I run into:
...
FAIL: gdb.base/gold-gdb-index.exp: maint info symtabs
...

This is due to a dummy .gdb_index:
...
Contents of the .gdb_index section:

Version 7

CU table:

TU table:

Address table:

Symbol table:
...

The dummy .gdb_index is ignored when loading the symbols, and instead partial
symbols are used.  Consequently, we get the same result as if we'd removed
-Wl,--gdb-index from the compilation.

Presumably, gold fails to generate a proper .gdb_index because it lacks
DWARF5 support.

Anyway, without a proper .gdb_index we can't test the gdb behaviour we're
trying to excercise.  Fix this by detecting whether we actually used a
.gdb_index for symbol loading.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2021-07-14  Tom de Vries  <tdevries@suse.de>

* lib/gdb.exp (have_index): New proc.
* gdb.base/gold-gdb-index.exp: Use have_index.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/gold-gdb-index.exp
gdb/testsuite/lib/gdb.exp
This page took 0.026203 seconds and 4 git commands to generate.