aboutsummaryrefslogtreecommitdiff
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
commitdbfc69bef9d6f211fa1b42ee38c2e678079def3a (patch)
treef8ec7de7681b3bf038dd23749e4208e41b8f7300
parent47265957ad9b1de1d6434baa0569d286d75eaf48 (diff)
downloadgdb-dbfc69bef9d6f211fa1b42ee38c2e678079def3a.zip
gdb-dbfc69bef9d6f211fa1b42ee38c2e678079def3a.tar.gz
gdb-dbfc69bef9d6f211fa1b42ee38c2e678079def3a.tar.bz2
[gdb/testsuite] Handle readnow in ensure_gdb_index
When running test-case gdb.base/with-mf.exp with target board readnow, I run into: ... FAIL: gdb.base/with-mf.exp: check if index present ... This is since commit 6010fb0c49e "[gdb/testsuite] Fix full buffer in gdb.rust/dwindex.exp". Before that commit, the proc ensure_gdb_index would treat the line: ... .gdb_index: faked for "readnow"^M ... as proof that an index is already present (which is incorrect). Now, instead it generates aforementioned FAIL and continues to generate an index. Fix this by explicitly handling the readnow case in proc ensure_gdb_index, such that we bail out instead. Tested on x86_64-linux.
-rw-r--r--gdb/testsuite/lib/gdb.exp9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 6a5cdc0..c2e6595 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -7922,6 +7922,7 @@ proc ensure_gdb_index { binfile {style ""} } {
set testfile [file tail $binfile]
set test "check if index present"
set has_index 0
+ set has_readnow 0
gdb_test_multiple "mt print objfiles ${testfile}" $test -lbl {
-re "\r\n\\.gdb_index: version ${decimal}(?=\r\n)" {
set has_index 1
@@ -7934,6 +7935,10 @@ proc ensure_gdb_index { binfile {style ""} } {
-re "\r\nPsymtabs:(?=\r\n)" {
gdb_test_lines "" $gdb_test_name ".*"
}
+ -re ".gdb_index: faked for \"readnow\"" {
+ set has_readnow 1
+ gdb_test_lines "" $gdb_test_name ".*"
+ }
-re -wrap "" {
fail $gdb_test_name
}
@@ -7943,6 +7948,10 @@ proc ensure_gdb_index { binfile {style ""} } {
return 0
}
+ if { $has_readnow } {
+ return -1
+ }
+
if { [add_gdb_index $binfile $style] == "1" } {
return 1
}