aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2021-10-11 12:21:00 +0200
committerTom de Vries <tdevries@suse.de>2021-10-11 12:21:00 +0200
commit47265957ad9b1de1d6434baa0569d286d75eaf48 (patch)
tree83264dd8112bd6d7c87c880fbff6b7eec0a8d331 /gdb/testsuite
parent4f69f0a21ef0a22e5e7d82ba271d6a7330469fb1 (diff)
downloadfsf-binutils-gdb-47265957ad9b1de1d6434baa0569d286d75eaf48.zip
fsf-binutils-gdb-47265957ad9b1de1d6434baa0569d286d75eaf48.tar.gz
fsf-binutils-gdb-47265957ad9b1de1d6434baa0569d286d75eaf48.tar.bz2
[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.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp13
1 files changed, 13 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp b/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp
index eaeddec..74c558a 100644
--- a/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp
+++ b/gdb/testsuite/gdb.dwarf2/gdb-add-index-symlink.exp
@@ -22,6 +22,19 @@ if {![dwarf2_support]} {
standard_testfile main.c
+# First check whether we can actually handle the non-symlink case.
+with_test_prefix non-symlink {
+ if { [prepare_for_testing "failed to prepare" "${testfile}" \
+ [list ${srcfile}]] } {
+ return -1
+ }
+
+ if { [ensure_gdb_index $binfile] == -1 } {
+ return -1
+ }
+}
+
+# Regenerate exec without index.
if { [prepare_for_testing "failed to prepare" "${testfile}" \
[list ${srcfile}]] } {
return -1