[ob/pushed] Make gdb_continue_to_breakpoint fail quickly on internal errors.

Message ID 1398190805-6859-1-git-send-email-palves@redhat.com
State Committed
Headers

Commit Message

Pedro Alves April 22, 2014, 6:20 p.m. UTC
  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   | 5 +++++
 gdb/testsuite/lib/gdb.exp | 9 +--------
 2 files changed, 6 insertions(+), 8 deletions(-)
  

Comments

Joel Brobecker April 23, 2014, 1:27 p.m. UTC | #1
> 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.

Yay for this patch! Thanks, Pedro.
  

Patch

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 865fd0c..1de6dc0 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -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.
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 5411cb5..d904b81 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -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)"
-	}
     }
 }