[ob] Fix a gdbserver testsuite glitch

Daniel Jacobowitz drow@false.org
Wed Oct 18 16:51:00 GMT 2006


The new sepsymtab.exp test failed for gdbserver.  It's a bit special in that
I used Bob's trick for matching MI output exactly: the pattern includes the
command as we sent it, plus the expected output, to make sure there are no
extra lines of output.  We were failing to eat the space after $gdb_prompt
after "target remote".

Tested and committed.

-- 
Daniel Jacobowitz
CodeSourcery

2006-10-18  Daniel Jacobowitz  <dan@codesoucery.com>

	* lib/gdbserver-support.exp (gdb_target_cmd): Anchor the ends
	of patterns.

Index: testsuite/lib/gdbserver-support.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/gdbserver-support.exp,v
retrieving revision 1.1
diff -u -p -r1.1 gdbserver-support.exp
--- testsuite/lib/gdbserver-support.exp	8 Apr 2005 12:57:00 -0000	1.1
+++ testsuite/lib/gdbserver-support.exp	18 Oct 2006 16:48:29 -0000
@@ -1,4 +1,5 @@
-# Copyright 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+# Copyright 2000, 2002, 2003, 2004, 2005, 2006
+# Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -51,32 +52,32 @@ proc gdb_target_cmd { targetname serialp
 		send_gdb "y\n"
 		exp_continue
 	    }
-	    -re "Couldn't establish connection to remote.*$gdb_prompt" {
+	    -re "Couldn't establish connection to remote.*$gdb_prompt $" {
 		verbose "Connection failed"
 	    }
 	    -re "Remote MIPS debugging.*$gdb_prompt" {
 		verbose "Set target to $targetname"
 		return 0
 	    }
-	    -re "Remote debugging using .*$serialport.*$gdb_prompt" {
+	    -re "Remote debugging using .*$serialport.*$gdb_prompt $" {
 		verbose "Set target to $targetname"
 		return 0
 	    }
-	    -re "Remote target $targetname connected to.*$gdb_prompt" {
+	    -re "Remote target $targetname connected to.*$gdb_prompt $" {
 		verbose "Set target to $targetname"
 		return 0
 	    }
-	    -re "Connected to.*$gdb_prompt" { 
+	    -re "Connected to.*$gdb_prompt $" { 
 		verbose "Set target to $targetname"
 		return 0
 	    }
-	    -re "Ending remote.*$gdb_prompt" { }
-	    -re "Connection refused.*$gdb_prompt" {
+	    -re "Ending remote.*$gdb_prompt $" { }
+	    -re "Connection refused.*$gdb_prompt $" {
 		verbose "Connection refused by remote target.  Pausing, and trying again."
 		sleep 30
 		continue
 	    }
-	    -re "Timeout reading from remote system.*$gdb_prompt" {
+	    -re "Timeout reading from remote system.*$gdb_prompt $" {
 		verbose "Got timeout error from gdb."
 	    }
 	    timeout {



More information about the Gdb-patches mailing list