public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] testsuite: Fix a "continue" outside of a loop error
@ 2011-12-01 15:34 Maciej W. Rozycki
  2011-12-05 13:50 ` Joel Brobecker
  0 siblings, 1 reply; 3+ messages in thread
From: Maciej W. Rozycki @ 2011-12-01 15:34 UTC (permalink / raw)
  To: gdb-patches

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}"

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] testsuite: Fix a "continue" outside of a loop error
  2011-12-01 15:34 [PATCH] testsuite: Fix a "continue" outside of a loop error Maciej W. Rozycki
@ 2011-12-05 13:50 ` Joel Brobecker
  2012-02-27 21:04   ` Maciej W. Rozycki
  0 siblings, 1 reply; 3+ messages in thread
From: Joel Brobecker @ 2011-12-05 13:50 UTC (permalink / raw)
  To: Maciej W. Rozycki; +Cc: gdb-patches

>  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.

Please give it a few more days in case someone else would like to
comment. But if no one else does, please go ahead and commit.

-- 
Joel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] testsuite: Fix a "continue" outside of a loop error
  2011-12-05 13:50 ` Joel Brobecker
@ 2012-02-27 21:04   ` Maciej W. Rozycki
  0 siblings, 0 replies; 3+ messages in thread
From: Maciej W. Rozycki @ 2012-02-27 21:04 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

On Mon, 5 Dec 2011, Joel Brobecker wrote:

> >  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.
> 
> Please give it a few more days in case someone else would like to
> comment. But if no one else does, please go ahead and commit.

 No comments received, so I have checked it in now.  Thanks for your 
review.

  Maciej

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-02-27 20:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-01 15:34 [PATCH] testsuite: Fix a "continue" outside of a loop error Maciej W. Rozycki
2011-12-05 13:50 ` Joel Brobecker
2012-02-27 21:04   ` Maciej W. Rozycki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).