[gdb/testsuite] Fix gdb.dwarf2/gdb-add-index-symlink.exp
authorTom de Vries <tdevries@suse.de>
Mon, 11 Oct 2021 10:21:00 +0000 (12:21 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 11 Oct 2021 10:21:00 +0000 (12:21 +0200)
commit47265957ad9b1de1d6434baa0569d286d75eaf48
tree83264dd8112bd6d7c87c880fbff6b7eec0a8d331
parent4f69f0a21ef0a22e5e7d82ba271d6a7330469fb1
[gdb/testsuite] Fix gdb.dwarf2/gdb-add-index-symlink.exp

The test-case gdb.dwarf2/gdb-add-index-symlink.exp interpretes a failure to
add an index as a failure to add an index for a symlink:
...
if { [ensure_gdb_index $symlink] == -1 } {
    fail "Unable to call gdb-add-index with a symlink to a symfile"
    return -1
}
...

However, it's possible that the gdb-add-index also fails with a regular
file.  Add a check for that situation.

Tested on x86_64-linux.
gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp