aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2023-01-03 14:22:16 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2023-01-04 11:19:50 -0500
commit4b9728bec157796478831972fc8d07306dd9dcde (patch)
treef91e989aa8a599c156338d09d64dbe152d42b220
parent478eebf831985d4c4aeb4c781e20b0d7ecce5baf (diff)
downloadgdb-4b9728bec157796478831972fc8d07306dd9dcde.zip
gdb-4b9728bec157796478831972fc8d07306dd9dcde.tar.gz
gdb-4b9728bec157796478831972fc8d07306dd9dcde.tar.bz2
gdb: use gdb_test_multiple in gdb_breakpoint
When running the testsuite in a non-optimized build on a slow machine, I sometimes get: UNTESTED: gdb.gdb/selftest.exp: Cannot set breakpoint at captured_main, skipping testcase. do_self_tests, in lib/selftest-support.exp, uses `with_timeout_factor 10`, to account for the fact that reading the debug info of the gdb binary (especially in a non-optimized GDB) can take time. But then it ends up calling gdb_breakpoint, which uses gdb_expect with a hard-coded timeout of 30 seconds. Fix this by making gdb_breakpoint use gdb_test_multiple, which is a desired change anyway for this kind of simple command / expected output case. Change-Id: I9b06ce991cc584810d8cc231b2b4893980b8be75 Reviewed-By: Lancelot Six <lancelot.six@amd.com>
-rw-r--r--gdb/testsuite/lib/gdb.exp36
1 files changed, 2 insertions, 34 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 135ace6..ba16b2a 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -639,18 +639,15 @@ proc gdb_breakpoint { linespec args } {
set print_pass 1
}
- set test_name "gdb_breakpoint: set breakpoint at $linespec"
-
- send_gdb "$break_command $linespec\n"
# The first two regexps are what we get with -g, the third is without -g.
- gdb_expect 30 {
+ gdb_test_multiple "$break_command $linespec" "gdb_breakpoint: set breakpoint at $linespec" {
-re "$break_message \[0-9\]* at .*: file .*, line $decimal.\r\n$gdb_prompt $" {}
-re "$break_message \[0-9\]*: file .*, line $decimal.\r\n$gdb_prompt $" {}
-re "$break_message \[0-9\]* at .*$gdb_prompt $" {}
-re "$break_message \[0-9\]* \\(.*\\) pending.*$gdb_prompt $" {
if {$pending_response == "n"} {
if { $print_fail } {
- fail $test_name
+ fail $gdb_name_name
}
return 0
}
@@ -659,35 +656,6 @@ proc gdb_breakpoint { linespec args } {
send_gdb "$pending_response\n"
exp_continue
}
- -re "A problem internal to GDB has been detected" {
- if { $print_fail } {
- fail "$test_name (GDB internal error)"
- }
- gdb_internal_error_resync
- return 0
- }
- -re "$gdb_prompt $" {
- if { $print_fail } {
- fail $test_name
- }
- return 0
- }
- eof {
- perror "GDB process no longer exists"
- global gdb_spawn_id
- set wait_status [wait -i $gdb_spawn_id]
- verbose -log "GDB process exited with wait status $wait_status"
- if { $print_fail } {
- fail "$test_name (eof)"
- }
- return 0
- }
- timeout {
- if { $print_fail } {
- fail "$test_name (timeout)"
- }
- return 0
- }
}
if { $print_pass } {
pass $test_name