mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-22 02:50:08 +08:00
[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.
This commit is contained in:
@ -7922,6 +7922,7 @@ proc ensure_gdb_index { binfile {style ""} } {
|
|||||||
set testfile [file tail $binfile]
|
set testfile [file tail $binfile]
|
||||||
set test "check if index present"
|
set test "check if index present"
|
||||||
set has_index 0
|
set has_index 0
|
||||||
|
set has_readnow 0
|
||||||
gdb_test_multiple "mt print objfiles ${testfile}" $test -lbl {
|
gdb_test_multiple "mt print objfiles ${testfile}" $test -lbl {
|
||||||
-re "\r\n\\.gdb_index: version ${decimal}(?=\r\n)" {
|
-re "\r\n\\.gdb_index: version ${decimal}(?=\r\n)" {
|
||||||
set has_index 1
|
set has_index 1
|
||||||
@ -7934,6 +7935,10 @@ proc ensure_gdb_index { binfile {style ""} } {
|
|||||||
-re "\r\nPsymtabs:(?=\r\n)" {
|
-re "\r\nPsymtabs:(?=\r\n)" {
|
||||||
gdb_test_lines "" $gdb_test_name ".*"
|
gdb_test_lines "" $gdb_test_name ".*"
|
||||||
}
|
}
|
||||||
|
-re ".gdb_index: faked for \"readnow\"" {
|
||||||
|
set has_readnow 1
|
||||||
|
gdb_test_lines "" $gdb_test_name ".*"
|
||||||
|
}
|
||||||
-re -wrap "" {
|
-re -wrap "" {
|
||||||
fail $gdb_test_name
|
fail $gdb_test_name
|
||||||
}
|
}
|
||||||
@ -7943,6 +7948,10 @@ proc ensure_gdb_index { binfile {style ""} } {
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if { $has_readnow } {
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
|
||||||
if { [add_gdb_index $binfile $style] == "1" } {
|
if { [add_gdb_index $binfile $style] == "1" } {
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user