aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2015-02-23 17:35:09 +0000
committerPedro Alves <palves@redhat.com>2015-02-23 17:35:09 +0000
commitd8b901edd1a9b717bd397400ce498c7a2d9504d0 (patch)
tree63b4d85af2fb649c0a7db07ce36df5ef66626b6b /gdb
parentfd63f640f645878605e4b4bc33ca31fb51583ecd (diff)
downloadgdb-d8b901edd1a9b717bd397400ce498c7a2d9504d0.zip
gdb-d8b901edd1a9b717bd397400ce498c7a2d9504d0.tar.gz
gdb-d8b901edd1a9b717bd397400ce498c7a2d9504d0.tar.bz2
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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/lib/gdb.exp38
2 files changed, 29 insertions, 14 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 276749e..87f6c98 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,10 @@
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>
+
* gdb.base/info-os.c: Include stdlib.h.
2015-02-22 Doug Evans <xdje42@gmail.com>
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index bbc657c..08db806 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -181,25 +181,35 @@ proc delete_breakpoints {} {
# we need a larger timeout value here or this thing just confuses
# itself. May need a better implementation if possible. - guo
#
- send_gdb "delete breakpoints\n"
- gdb_expect 100 {
- -re "Delete all breakpoints.*y or n.*$" {
+ set timeout 100
+
+ 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"
exp_continue
}
- -re "$gdb_prompt $" { # This happens if there were no breakpoints
- }
- timeout { perror "Delete all breakpoints in delete_breakpoints (timeout)" ; return }
+ -re "$gdb_prompt $" {
+ set deleted 1
+ }
}
- send_gdb "info breakpoints\n"
- gdb_expect 100 {
- -re "No breakpoints or watchpoints..*$gdb_prompt $" {}
- -re "$gdb_prompt $" { perror "breakpoints not deleted" ; return }
- -re "Delete all breakpoints.*or n.*$" {
- send_gdb "y\n"
- exp_continue
+
+ if {$deleted} {
+ # Confirm with "info breakpoints".
+ set deleted 0
+ set msg "info breakpoints"
+ gdb_test_multiple $msg $msg {
+ -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"
}
}