Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: Pedro Alves <pedro@codesourcery.com>, gdb-patches@sourceware.org
Subject: Re: Regression:  [Re: RFC: change "program exited" message]
Date: Wed, 09 Mar 2011 14:37:00 -0000	[thread overview]
Message-ID: <m339mwfki3.fsf@fleche.redhat.com> (raw)
In-Reply-To: <m3zkp5iscv.fsf@fleche.redhat.com> (Tom Tromey's message of "Tue,	08 Mar 2011 07:45:04 -0700")

Jan> This has a heavy regression for me such as:
Jan> FAIL: gdb.base/break.exp: continue until exit at recursive next test (the program exited)

Tom> I will fix it.

Here is the fix.

I built and regtested this on the compile farm, but we already know that
may have some issues.  But, I also went through the log you posted and
ran every failing test locally, before and after.  Some of the things in
that log don't seem to be related to my patch.  E.g., the
attachstop-mt.exp failure.

If you still see problems after this, just let me know and I will fix
those too.

Tom

2011-03-09  Tom Tromey  <tromey@redhat.com>

	* lib/gdb.exp (inferior_exited_re): Match. leading `['.  Wrap in
	parentheses.
	(gdb_continue_to_end): Add "allow_extra" parameter.  Use
	$command.
	* gdb.threads/thread-unwindonsignal.exp: Pass "allow_extra"
	argument to gdb_continue_to_end.
	* gdb.threads/interrupted-hand-call.exp: Pass "allow_extra"
	argument to gdb_continue_to_end.
	* gdb.cp/annota3.exp: Fix regex.
	* gdb.cp/annota2.exp: Fix regex.
	* gdb.base/shlib-call.exp: Pass "allow_extra" argument to
	gdb_continue_to_end.
	* gdb.base/call-signal-resume.exp: Revert earlier patch.
	* gdb.ada/tasks.exp: Pass "allow_extra" argument to
	gdb_continue_to_end.

Index: testsuite/gdb.ada/tasks.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.ada/tasks.exp,v
retrieving revision 1.5
diff -u -r1.5 tasks.exp
--- testsuite/gdb.ada/tasks.exp	7 Mar 2011 16:03:01 -0000	1.5
+++ testsuite/gdb.ada/tasks.exp	9 Mar 2011 14:10:39 -0000
@@ -70,5 +70,4 @@
 # Now, resume the execution and make sure that GDB does not stop when
 # task 4 hits the breakpoint. Continuing thus results in our program
 # running to completion.
-gdb_continue_to_end
-
+gdb_continue_to_end "" continue 1
Index: testsuite/gdb.base/call-signal-resume.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/call-signal-resume.exp,v
retrieving revision 1.9
diff -u -r1.9 call-signal-resume.exp
--- testsuite/gdb.base/call-signal-resume.exp	7 Mar 2011 16:03:02 -0000	1.9
+++ testsuite/gdb.base/call-signal-resume.exp	9 Mar 2011 14:10:39 -0000
@@ -146,6 +146,7 @@
 
 # Continue one last time, the program should exit normally.
 
-gdb_continue_to_end
+gdb_test "continue" "$inferior_exited_re normally." \
+    "continue to program exit"
 
 return 0
Index: testsuite/gdb.base/shlib-call.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/shlib-call.exp,v
retrieving revision 1.22
diff -u -r1.22 shlib-call.exp
--- testsuite/gdb.base/shlib-call.exp	7 Mar 2011 16:03:02 -0000	1.22
+++ testsuite/gdb.base/shlib-call.exp	9 Mar 2011 14:10:39 -0000
@@ -182,12 +182,12 @@
   gdb_test "run" "Starting program:.*Breakpoint .,.*" \
 	"run to bp in shared library"
 
-  gdb_continue_to_end
+  gdb_continue_to_end "" continue 1
 
   gdb_test "run" "Starting program:.*Breakpoint .,.*" \
 	"re-run to bp in shared library (PR's 16495, 18213)"
 
-  gdb_continue_to_end
+  gdb_continue_to_end "" continue 1
 }
 
 return 0
Index: testsuite/gdb.cp/annota2.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/annota2.exp,v
retrieving revision 1.22
diff -u -r1.22 annota2.exp
--- testsuite/gdb.cp/annota2.exp	7 Mar 2011 16:03:02 -0000	1.22
+++ testsuite/gdb.cp/annota2.exp	9 Mar 2011 14:10:39 -0000
@@ -116,7 +116,7 @@
 # `a.x is 1' is asynchronous regarding to `frames-invalid'.
 #
 gdb_test_multiple "continue" "continue until exit" {
-    -re "\r\n\032\032post-prompt\r\nContinuing.\r\n\r\n\032\032starting\(\r\n\r\n\032\032frames-invalid\)*\r\na.x is 1\r\n\(\r\n\032\032frames-invalid\r\n\)*\r\n\032\032exited 0\r\n.$inferior_exited_re normally.\r\n\r\n\032\032stopped\r\n$gdb_prompt$" {
+    -re "\r\n\032\032post-prompt\r\nContinuing.\r\n\r\n\032\032starting\(\r\n\r\n\032\032frames-invalid\)*\r\na.x is 1\r\n\(\r\n\032\032frames-invalid\r\n\)*\r\n\032\032exited 0\r\n$inferior_exited_re normally.\r\n\r\n\032\032stopped\r\n$gdb_prompt$" {
 	pass "continue until exit"
     }
 }
Index: testsuite/gdb.cp/annota3.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/annota3.exp,v
retrieving revision 1.20
diff -u -r1.20 annota3.exp
--- testsuite/gdb.cp/annota3.exp	7 Mar 2011 16:03:02 -0000	1.20
+++ testsuite/gdb.cp/annota3.exp	9 Mar 2011 14:10:39 -0000
@@ -116,15 +116,14 @@
 # annotate-exited
 #
 send_gdb "continue\n"
-gdb_expect_list "continue to exit" "$gdb_prompt$" {
+gdb_expect_list "continue to exit" "$gdb_prompt$" [concat {
     "\r\n\032\032post-prompt\r\n"
     "Continuing.\r\n"
     "\r\n\032\032starting\r\n"
     "a.x is 1\r\n"
-    "\r\n\032\032exited 0\r\n"
-    ".$inferior_exited_re normally.\r\n"
+    "\r\n\032\032exited 0\r\n"} [list "$inferior_exited_re normally.\r\n"] {
     "\r\n\032\032stopped\r\n"
-}
+}]
 
 #
 # delete all breakpoints
Index: testsuite/gdb.threads/interrupted-hand-call.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.threads/interrupted-hand-call.exp,v
retrieving revision 1.5
diff -u -r1.5 interrupted-hand-call.exp
--- testsuite/gdb.threads/interrupted-hand-call.exp	7 Mar 2011 16:03:03 -0000	1.5
+++ testsuite/gdb.threads/interrupted-hand-call.exp	9 Mar 2011 14:10:39 -0000
@@ -86,6 +86,6 @@
 
 # Continue one last time, the program should exit normally.
 
-gdb_continue_to_end
+gdb_continue_to_end "" continue 1
 
 return 0
Index: testsuite/gdb.threads/thread-unwindonsignal.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.threads/thread-unwindonsignal.exp,v
retrieving revision 1.6
diff -u -r1.6 thread-unwindonsignal.exp
--- testsuite/gdb.threads/thread-unwindonsignal.exp	7 Mar 2011 16:03:03 -0000	1.6
+++ testsuite/gdb.threads/thread-unwindonsignal.exp	9 Mar 2011 14:10:39 -0000
@@ -110,6 +110,6 @@
 
 # Continue one last time, the program should exit normally.
 
-gdb_continue_to_end
+gdb_continue_to_end "" continue 1
 
 return 0
Index: testsuite/lib/gdb.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/gdb.exp,v
retrieving revision 1.166
diff -u -r1.166 gdb.exp
--- testsuite/lib/gdb.exp	7 Mar 2011 16:03:04 -0000	1.166
+++ testsuite/lib/gdb.exp	9 Mar 2011 14:10:39 -0000
@@ -99,7 +99,7 @@
 
 set octal "\[0-7\]+"
 
-set inferior_exited_re "Inferior \[0-9\]+ \\(.*\\) exited"
+set inferior_exited_re "(\\\[Inferior \[0-9\]+ \\(.*\\) exited)"
 
 ### Only procedures should come after this point.
 
@@ -3062,8 +3062,12 @@
 #	default is used.
 # COMMAND is the command to invoke.  If not given, "continue" is
 #	used.
+# ALLOW_EXTRA is a flag indicating whether the test should expect
+#	extra output between the "Continuing." line and the program
+#	exiting.  By default it is zero; if nonzero, any extra output
+#	is accepted.
 
-proc gdb_continue_to_end {{mssg ""} {command continue}} {
+proc gdb_continue_to_end {{mssg ""} {command continue} {allow_extra 0}} {
   global inferior_exited_re
 
   if {$mssg == ""} {
@@ -3071,18 +3075,23 @@
   } else {
       set text "continue until exit at $mssg"
   }
+  if {$allow_extra} {
+      set extra ".*"
+  } else {
+      set extra ""
+  }
   if [target_info exists use_gdb_stub] {
     if {![gdb_breakpoint "exit"]} {
       return 0
     }
-    gdb_test "continue" "Continuing..*Breakpoint .*exit.*" \
+    gdb_test $command "Continuing..*Breakpoint .*exit.*" \
 	$text
   } else {
     # Continue until we exit.  Should not stop again.
     # Don't bother to check the output of the program, that may be
     # extremely tough for some remote systems.
-    gdb_test "continue"\
-      "Continuing.\[\r\n0-9\]+(... EXIT code 0\[\r\n\]+|$inferior_exited_re normally).*"\
+    gdb_test $command \
+      "Continuing.\[\r\n0-9\]+${extra}(... EXIT code 0\[\r\n\]+|$inferior_exited_re normally).*"\
 	$text
   }
 }


  reply	other threads:[~2011-03-09 14:15 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-03 20:52 RFC: change "program exited" message Tom Tromey
2011-03-03 21:18 ` Michael Snyder
2011-03-03 21:20 ` Pedro Alves
2011-03-04  7:37   ` Eli Zaretskii
2011-03-04 17:24   ` Tom Tromey
2011-03-04 19:13     ` Pedro Alves
2011-03-04 19:23       ` Tom Tromey
2011-03-04 19:38         ` Pedro Alves
2011-03-07 16:17           ` Tom Tromey
2011-03-08  9:43             ` Regression: [Re: RFC: change "program exited" message] Jan Kratochvil
2011-03-08 15:11               ` Tom Tromey
2011-03-09 14:37                 ` Tom Tromey [this message]
2011-03-09 16:22                   ` Jan Kratochvil
2011-03-09 16:29                     ` Joel Brobecker
2011-03-09 17:28                     ` Tom Tromey
2011-03-09 17:32                       ` Jan Kratochvil
2011-03-09 18:15                         ` Tom Tromey
2011-03-09 18:22                           ` Jan Kratochvil
2011-03-09 18:58                             ` Tom Tromey
2011-03-04  9:12 ` RFC: change "program exited" message Mark Kettenis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m339mwfki3.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=pedro@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox