Make gdb_continue_to_breakpoint fail quickly on internal errors.
authorPedro Alves <palves@redhat.com>
Tue, 22 Apr 2014 18:15:48 +0000 (19:15 +0100)
committerPedro Alves <palves@redhat.com>
Tue, 22 Apr 2014 18:15:48 +0000 (19:15 +0100)
This switches the gdb_continue_to_breakpoint routine to use
gdb_test_multiple instead of send_gdb/gdb_expect, so that an internal
error is detected immediately, instead of failing on timeout.

gdb/testsuite/
2014-04-22  Pedro Alves  <palves@redhat.com>

* lib/gdb.exp (gdb_continue_to_breakpoint): Use gdb_test_multiple
instead of send_gdb/gdb_expect.

gdb/testsuite/ChangeLog
gdb/testsuite/lib/gdb.exp

index 865fd0c1e3c20cb3e2e85f8f98d4e5f882df5c5b..1de6dc0864d7ef595c7b1621b352e157d6f315eb 100644 (file)
@@ -1,3 +1,8 @@
+2014-04-22  Pedro Alves  <palves@redhat.com>
+
+       * lib/gdb.exp (gdb_continue_to_breakpoint): Use gdb_test_multiple
+       instead of send_gdb/gdb_expect.
+
 2014-04-22  Yao Qi  <yao@codesourcery.com>
 
        * lib/trace-support.exp (generate_tracefile): New procedure.
index 5411cb5b23fe07ba00b14ebdaaec51b05eba305e..d904b81f13d2dbb7adc3b004ff26ca340cedafab 100644 (file)
@@ -549,17 +549,10 @@ proc gdb_continue_to_breakpoint {name {location_pattern .*}} {
     global gdb_prompt
     set full_name "continue to breakpoint: $name"
 
-    send_gdb "continue\n"
-    gdb_expect {
+    gdb_test_multiple "continue" $full_name {
        -re "(?:Breakpoint|Temporary breakpoint) .* (at|in) $location_pattern\r\n$gdb_prompt $" {
            pass $full_name
        }
-       -re ".*$gdb_prompt $" {
-           fail $full_name
-       }
-       timeout { 
-           fail "$full_name (timeout)"
-       }
     }
 }