From: Tom de Vries Date: Mon, 11 Oct 2021 10:21:00 +0000 (+0200) Subject: [gdb/testsuite] Handle readnow in ensure_gdb_index X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dbfc69bef9d6f211fa1b42ee38c2e678079def3a;p=binutils-gdb.git [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. --- diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 6a5cdc06485..c2e6595f594 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 }