mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-24 20:28:28 +08:00
[gdb/testsuite] Fix gdb.base/info_sources_2.exp with check-read1
When running test-case gdb.base/info_sources_2.exp with check-read1, I run into: ... FAIL: gdb.base/info_sources_2.exp: args: : info sources (timeout) ... Fix this by consuming a "$src1, $src2, ..., $srcn: line bit by bit rather than as one whole line. Also add the missing handling of "Objfile has no debug information". Tested on x86_64-linux.
This commit is contained in:
@ -68,6 +68,7 @@ proc run_info_sources { extra_args args } {
|
|||||||
# Run the command and extract the results into INFO_SOURCES.
|
# Run the command and extract the results into INFO_SOURCES.
|
||||||
set objfile_name ""
|
set objfile_name ""
|
||||||
set source_files {}
|
set source_files {}
|
||||||
|
set files {}
|
||||||
gdb_test_multiple $cmd "" {
|
gdb_test_multiple $cmd "" {
|
||||||
-re "${command_regex}\r\n" {
|
-re "${command_regex}\r\n" {
|
||||||
exp_continue
|
exp_continue
|
||||||
@ -81,6 +82,9 @@ proc run_info_sources { extra_args args } {
|
|||||||
-re "^\\(Full debug information has not yet been read for this file\\.\\)\r\n" {
|
-re "^\\(Full debug information has not yet been read for this file\\.\\)\r\n" {
|
||||||
exp_continue
|
exp_continue
|
||||||
}
|
}
|
||||||
|
-re "^\\(Objfile has no debug information\\.\\)\r\n" {
|
||||||
|
exp_continue
|
||||||
|
}
|
||||||
|
|
||||||
-re "^\r\n" {
|
-re "^\r\n" {
|
||||||
exp_continue
|
exp_continue
|
||||||
@ -90,18 +94,22 @@ proc run_info_sources { extra_args args } {
|
|||||||
pass $gdb_test_name
|
pass $gdb_test_name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-re "^(\[^,\r\n\]+), " {
|
||||||
|
set f $expect_out(1,string)
|
||||||
|
lappend files $f
|
||||||
|
exp_continue
|
||||||
|
}
|
||||||
-re "^(\[^\r\n\]+)\r\n" {
|
-re "^(\[^\r\n\]+)\r\n" {
|
||||||
if { $objfile_name == "" } {
|
if { $objfile_name == "" } {
|
||||||
fail "${gdb_test_name} (no objfile name)"
|
fail "${gdb_test_name} (no objfile name)"
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
set files {}
|
set f $expect_out(1,string)
|
||||||
foreach f [split $expect_out(1,string) ,] {
|
lappend files $f
|
||||||
lappend files [string trim $f]
|
|
||||||
}
|
|
||||||
set info_sources($objfile_name) $files
|
set info_sources($objfile_name) $files
|
||||||
set $objfile_name ""
|
set $objfile_name ""
|
||||||
|
set files {}
|
||||||
exp_continue
|
exp_continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user