This is the mail archive of the gdb-patches@sourceware.org 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]
Other format: [Raw text]

[PATCH] testsuite: Fix a "continue" outside of a loop error


Hi,

 This change fixes this problem:

FAIL: gdb.cp/breakpoint.exp: running to main in runto (timeout)
ERROR: couldn't run to main when testing C1::Nested::foo
ERROR: tcl error sourcing .../gdb/testsuite/gdb.cp/breakpoint.exp.
ERROR: invoked "continue" outside of a loop
    (procedure "test_breakpoint" line 1)
    invoked from within
"test_breakpoint "C1::Nested::foo""
    (file ".../gdb/testsuite/gdb.cp/breakpoint.exp" line 60)
    invoked from within
"source .../gdb/testsuite/gdb.cp/breakpoint.exp"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 source .../gdb/testsuite/gdb.cp/breakpoint.exp"
    invoked from within
"catch "uplevel #0 source $test_file_name""

when runto_main fails for whatever reason.  Obviously there's no loop 
within test_breakpoint to continue.

 The function itself isn't called in a loop within the test script either, 
but functions of the same name are in other tests, so in case the test 
case is extended in the future I've decided to keep the property 
advertised in the comment associated with this piece of code and return 
the "continue" rather than the "return" status.  As it is they're 
equivalent.

2011-12-01  Maciej W. Rozycki  <macro@codesourcery.com>

	gdb/testsuite/
	* gdb.cp/breakpoint.exp (test_breakpoint): Fix the runto_main
	failure return path.

  Maciej

gdb-cp-breakpoint-test.diff
Index: gdb-fsf-trunk-quilt/gdb/testsuite/gdb.cp/breakpoint.exp
===================================================================
--- gdb-fsf-trunk-quilt.orig/gdb/testsuite/gdb.cp/breakpoint.exp	2011-12-01 14:10:33.000000000 +0000
+++ gdb-fsf-trunk-quilt/gdb/testsuite/gdb.cp/breakpoint.exp	2011-12-01 14:41:28.775561791 +0000
@@ -50,7 +50,7 @@ proc test_breakpoint {name} {
     # lead to a cascade.
     if ![runto_main] then {
 	perror "couldn't run to main when testing ${name}"
-	continue
+	return -code continue
     } else {
 	gdb_breakpoint "${name}"
 	gdb_test "continue" "Continuing.\r\n\r\nBreakpoint \[0-9\]*, ${name}.*" "continue to ${name}"


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