aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/testsuite/gdb.base/gold-gdb-index.exp2
-rw-r--r--gdb/testsuite/lib/gdb.exp28
2 files changed, 29 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.base/gold-gdb-index.exp b/gdb/testsuite/gdb.base/gold-gdb-index.exp
index 2a6da32..1af756a 100644
--- a/gdb/testsuite/gdb.base/gold-gdb-index.exp
+++ b/gdb/testsuite/gdb.base/gold-gdb-index.exp
@@ -28,7 +28,7 @@ if {[prepare_for_testing "failed to prepare" $testfile "$srcfile $srcfile2" \
return -1
}
-if { [readnow] } {
+if { [have_index $binfile] != "gdb_index" } {
return -1
}
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 6b6a70a..04ca561 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -7670,6 +7670,34 @@ proc readnow { args } {
return $readnow_p
}
+# Return index name if symbols were read in using an index.
+# Otherwise, return "".
+
+proc have_index { objfile } {
+
+ set res ""
+ set cmd "maint print objfiles $objfile"
+ gdb_test_multiple $cmd "" -lbl {
+ -re "\r\n.gdb_index: faked for \"readnow\"" {
+ set res ""
+ exp_continue
+ }
+ -re "\r\n.gdb_index:" {
+ set res "gdb_index"
+ exp_continue
+ }
+ -re "\r\n.debug_names:" {
+ set res "debug_names"
+ exp_continue
+ }
+ -re -wrap "" {
+ # We don't care about any other input.
+ }
+ }
+
+ return $res
+}
+
# Return 1 if partial symbols are available. Otherwise, return 0.
proc psymtabs_p { } {