mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-24 20:28:28 +08:00
delete_breakpoints: Rewrite using gdb_test_multiple
Because delete_breakpoints uses gdb_expect directly, an internal error results in slow timeouts instead of quickly bailing out. This patch rewrites the procedure to use gdb_test_multiple instead, while preserving the existing general logic ("delete breakpoints" + "info breakpoints"). gdb/testsuite/ 2015-02-23 Pedro Alves <palves@redhat.com> * lib/gdb.exp (delete_breakpoints): Rewrite using gdb_test_multiple.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2015-02-23 Pedro Alves <palves@redhat.com>
|
||||||
|
|
||||||
|
* lib/gdb.exp (delete_breakpoints): Rewrite using
|
||||||
|
gdb_test_multiple.
|
||||||
|
|
||||||
2015-02-23 Pedro Alves <palves@redhat.com>
|
2015-02-23 Pedro Alves <palves@redhat.com>
|
||||||
|
|
||||||
* gdb.base/info-os.c: Include stdlib.h.
|
* gdb.base/info-os.c: Include stdlib.h.
|
||||||
|
@ -181,25 +181,35 @@ proc delete_breakpoints {} {
|
|||||||
# we need a larger timeout value here or this thing just confuses
|
# we need a larger timeout value here or this thing just confuses
|
||||||
# itself. May need a better implementation if possible. - guo
|
# itself. May need a better implementation if possible. - guo
|
||||||
#
|
#
|
||||||
send_gdb "delete breakpoints\n"
|
set timeout 100
|
||||||
gdb_expect 100 {
|
|
||||||
-re "Delete all breakpoints.*y or n.*$" {
|
set msg "delete all breakpoints in delete_breakpoints"
|
||||||
|
set deleted 0
|
||||||
|
gdb_test_multiple "delete breakpoints" "$msg" {
|
||||||
|
-re "Delete all breakpoints.*y or n.*$" {
|
||||||
send_gdb "y\n"
|
send_gdb "y\n"
|
||||||
exp_continue
|
exp_continue
|
||||||
}
|
}
|
||||||
-re "$gdb_prompt $" { # This happens if there were no breakpoints
|
-re "$gdb_prompt $" {
|
||||||
}
|
set deleted 1
|
||||||
timeout { perror "Delete all breakpoints in delete_breakpoints (timeout)" ; return }
|
}
|
||||||
}
|
}
|
||||||
send_gdb "info breakpoints\n"
|
|
||||||
gdb_expect 100 {
|
if {$deleted} {
|
||||||
-re "No breakpoints or watchpoints..*$gdb_prompt $" {}
|
# Confirm with "info breakpoints".
|
||||||
-re "$gdb_prompt $" { perror "breakpoints not deleted" ; return }
|
set deleted 0
|
||||||
-re "Delete all breakpoints.*or n.*$" {
|
set msg "info breakpoints"
|
||||||
send_gdb "y\n"
|
gdb_test_multiple $msg $msg {
|
||||||
exp_continue
|
-re "No breakpoints or watchpoints..*$gdb_prompt $" {
|
||||||
|
set deleted 1
|
||||||
|
}
|
||||||
|
-re "$gdb_prompt $" {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
timeout { perror "info breakpoints (timeout)" ; return }
|
}
|
||||||
|
|
||||||
|
if {!$deleted} {
|
||||||
|
perror "breakpoints not deleted"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user