This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[patch] Recover quicker from dud MI output


Hello,

When GDB/MI gives a response that isn't as expected the testsuite has a 
habit of just sitting there in the vain hope that the correctly output 
might magically appear.

The attatched patch tweeks the MI testsuite so that for the cases I 
noticed (all todo with startup) it instead detects the dud output 
immediatly.

	Andrew
2001-08-18  Andrew Cagney  <ac131313@redhat.com>

	* mi0-until.exp, mi-until.exp, mi0-stepi.exp, mi-stepi.exp,
	mi-simplerun.exp, mi0-simplerun.exp, mi0-return.exp,
	mi-return.exp, mi0-console.exp, mi-console.exp: Recognize an
	unexpected run-to-main response. Report as a fail.

Index: gdb.mi/mi-console.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-console.exp,v
retrieving revision 1.5
diff -p -r1.5 mi-console.exp
*** mi-console.exp	2001/06/26 04:48:48	1.5
--- mi-console.exp	2001/08/19 00:23:50
*************** gdb_expect {
*** 60,65 ****
--- 60,68 ----
      -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*mi-console.c\",line=\"13\"\}\r\n$mi_gdb_prompt$" {
  	    pass "run to main"
      }
+     -re ".*$mi_gdb_prompt$" {
+ 	fail "run to main (2)"
+     }
      timeout {
  	fail "run to main (timeout)"
      }
Index: gdb.mi/mi-return.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-return.exp,v
retrieving revision 1.5
diff -p -r1.5 mi-return.exp
*** mi-return.exp	2001/06/26 04:48:48	1.5
--- mi-return.exp	2001/08/19 00:23:50
*************** proc test_running_to_callee4 {} {
*** 60,65 ****
--- 60,68 ----
  	-re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"callee4\",args=\\\[\\\],file=\".*basics.c\",line=\"8\"\}\r\n$mi_gdb_prompt$" {
  	    pass "run to callee4"
  	}
+ 	-re ".*$mi_gdb_prompt$" {
+ 	    fail "run to callee4 (2)"
+ 	}
  	timeout {
  	    fail "run to callee4 (timeout)"
  	}
Index: gdb.mi/mi-simplerun.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-simplerun.exp,v
retrieving revision 1.6
diff -p -r1.6 mi-simplerun.exp
*** mi-simplerun.exp	2001/06/27 17:27:07	1.6
--- mi-simplerun.exp	2001/08/19 00:23:51
*************** proc test_running_the_program {} {
*** 107,112 ****
--- 107,115 ----
  	-re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"32\"\}\r\n$mi_gdb_prompt$" {
  	    pass "run to main"
  	}
+ 	-re ".*$mi_gdb_prompt$" {
+ 	    fail "run to main (2)"
+ 	}
  	timeout {
  	    fail "run to main (timeout)"
  	}
Index: gdb.mi/mi-stepi.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-stepi.exp,v
retrieving revision 1.5
diff -p -r1.5 mi-stepi.exp
*** mi-stepi.exp	2001/06/26 04:48:48	1.5
--- mi-stepi.exp	2001/08/19 00:23:51
*************** proc test_running_to_main {} {
*** 60,65 ****
--- 60,68 ----
  	-re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\\\[\\\],file=\".*basics.c\",line=\"32\"\}\r\n$mi_gdb_prompt$" {
  	    pass "run to main"
  	}
+ 	-re ".*$mi_gdb_prompt$" {
+ 	    fail "run to main (2)"
+ 	}
  	timeout {
  	    fail "run to main (timeout)"
  	}
Index: gdb.mi/mi-until.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-until.exp,v
retrieving revision 1.5
diff -p -r1.5 mi-until.exp
*** mi-until.exp	2001/06/26 04:48:48	1.5
--- mi-until.exp	2001/08/19 00:23:52
*************** proc test_running_to_foo {} {
*** 60,65 ****
--- 60,68 ----
  	-re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"foo\",args=\\\[\\\],file=\".*until.c\",line=\"10\"\}\r\n$mi_gdb_prompt$" {
  	    pass "run to main"
  	}
+ 	-re ".*$mi_gdb_prompt$" {
+ 	    fail "run to main (2)"
+ 	}
  	timeout {
  	    fail "run to main (timeout)"
  	}
Index: gdb.mi/mi0-console.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi0-console.exp,v
retrieving revision 1.3
diff -p -r1.3 mi0-console.exp
*** mi0-console.exp	2001/06/23 21:47:09	1.3
--- mi0-console.exp	2001/08/19 00:23:52
*************** gdb_expect {
*** 60,65 ****
--- 60,68 ----
      -re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*mi-console.c\",line=\"13\"\}\r\n$mi_gdb_prompt$" {
  	    pass "run to main"
      }
+     -re ".*$mi_gdb_prompt$" {
+ 	fail "run to main (2)"
+     }
      timeout {
  	fail "run to main (timeout)"
      }
Index: gdb.mi/mi0-return.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi0-return.exp,v
retrieving revision 1.3
diff -p -r1.3 mi0-return.exp
*** mi0-return.exp	2001/06/23 21:47:09	1.3
--- mi0-return.exp	2001/08/19 00:23:52
*************** proc test_running_to_callee4 {} {
*** 60,65 ****
--- 60,68 ----
  	-re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"callee4\",args=\{\},file=\".*basics.c\",line=\"8\"\}\r\n$mi_gdb_prompt$" {
  	    pass "run to callee4"
  	}
+ 	-re ".*$mi_gdb_prompt$" {
+ 	    fail "run to callee4 (2)"
+ 	}
  	timeout {
  	    fail "run to callee4 (timeout)"
  	}
Index: gdb.mi/mi0-simplerun.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi0-simplerun.exp,v
retrieving revision 1.3
diff -p -r1.3 mi0-simplerun.exp
*** mi0-simplerun.exp	2001/06/23 21:47:09	1.3
--- mi0-simplerun.exp	2001/08/19 00:23:52
*************** proc test_running_the_program {} {
*** 107,112 ****
--- 107,115 ----
  	-re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*basics.c\",line=\"32\"\}\r\n$mi_gdb_prompt$" {
  	    pass "run to main"
  	}
+ 	-re ".*$mi_gdb_prompt$" {
+ 	    fail "run to main (2)"
+ 	}
  	timeout {
  	    fail "run to main (timeout)"
  	}
Index: gdb.mi/mi0-stepi.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi0-stepi.exp,v
retrieving revision 1.3
diff -p -r1.3 mi0-stepi.exp
*** mi0-stepi.exp	2001/06/23 21:47:09	1.3
--- mi0-stepi.exp	2001/08/19 00:23:52
*************** proc test_running_to_main {} {
*** 60,65 ****
--- 60,68 ----
  	-re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"main\",args=\{\},file=\".*basics.c\",line=\"32\"\}\r\n$mi_gdb_prompt$" {
  	    pass "run to main"
  	}
+ 	-re ".*$mi_gdb_prompt$" {
+ 	    fail "run to main (2)"
+ 	}
  	timeout {
  	    fail "run to main (timeout)"
  	}
Index: gdb.mi/mi0-until.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi0-until.exp,v
retrieving revision 1.3
diff -p -r1.3 mi0-until.exp
*** mi0-until.exp	2001/06/23 21:47:09	1.3
--- mi0-until.exp	2001/08/19 00:23:52
*************** proc test_running_to_foo {} {
*** 60,65 ****
--- 60,68 ----
  	-re "000\\*stopped,reason=\"breakpoint-hit\",bkptno=\"1\",thread-id=\"0\",frame=\{addr=\"$hex\",func=\"foo\",args=\{\},file=\".*until.c\",line=\"10\"\}\r\n$mi_gdb_prompt$" {
  	    pass "run to main"
  	}
+ 	-re ".*$mi_gdb_prompt$" {
+ 	    fail "run to main (2)"
+ 	}
  	timeout {
  	    fail "run to main (timeout)"
  	}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]