* [RFA] Handle output after 'Program exited normally' consistently
@ 2006-05-11 11:08 Fred Fish
2006-05-11 12:39 ` Daniel Jacobowitz
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Fred Fish @ 2006-05-11 11:08 UTC (permalink / raw)
To: gdb-patches; +Cc: fnf
There are 21 places in the current gdb testsuite where the testsuite checks
for 'Program exited normally' followed by a gdb prompt. All of them, with
the exception of a couple, use a test like:
-re ".*Program exited normally.*$gdb_prompt $" {
Note that this swallows and accepts anything between the exit message
and the prompt.
Current the bang.exp test is failing when run in the mips-elf simulator
because of some output between the message and the prompt:
Program exited normally.
Current language: auto; currently asm
(gdb)
which doesn't match the pattern checked for in bang.exp:
-re ".*Program exited normally\.\r\n$gdb_prompt $" {
I believe that the bang.exp test should be changed to make it consistent
with the other tests.
If we care about testing for cruft between the exit message and the
gdb prompt, to specifically catch that case, then I think that should
have it's own dedicated testcase, which I'm happy to write and submit.
-Fred
2006-05-11 Fred Fish <fnf@specifix.com>
* gdb.base/bang.exp: Ignore unexpected output between the
"program exited normally" and the gdb prompt, as many other
tests do.
Index: gdb.base/bang.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/bang.exp,v
retrieving revision 1.3
diff -u -p -r1.3 bang.exp
--- gdb.base/bang.exp 7 Mar 2006 15:23:32 -0000 1.3
+++ gdb.base/bang.exp 11 May 2006 11:03:21 -0000
@@ -38,7 +38,7 @@ gdb_load ${binfile}
gdb_run_cmd
gdb_expect {
- -re ".*Program exited normally\.\r\n$gdb_prompt $" {
+ -re ".*Program exited normally.*$gdb_prompt $" {
pass "run program"
}
timeout {
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [RFA] Handle output after 'Program exited normally' consistently
2006-05-11 11:08 [RFA] Handle output after 'Program exited normally' consistently Fred Fish
@ 2006-05-11 12:39 ` Daniel Jacobowitz
2006-05-11 14:39 ` [RFA] Handle output after 'Program exited normally' consistently (detect spurious output) Fred Fish
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: Daniel Jacobowitz @ 2006-05-11 12:39 UTC (permalink / raw)
To: Fred Fish; +Cc: gdb-patches
On Thu, May 11, 2006 at 07:09:11AM -0400, Fred Fish wrote:
> 2006-05-11 Fred Fish <fnf@specifix.com>
>
> * gdb.base/bang.exp: Ignore unexpected output between the
> "program exited normally" and the gdb prompt, as many other
> tests do.
OK.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [RFA] Handle output after 'Program exited normally' consistently (detect spurious output)
2006-05-11 11:08 [RFA] Handle output after 'Program exited normally' consistently Fred Fish
2006-05-11 12:39 ` Daniel Jacobowitz
@ 2006-05-11 14:39 ` Fred Fish
2006-05-15 15:57 ` Daniel Jacobowitz
2006-05-11 17:34 ` [RFA] Handle output after 'Program exited normally' consistently PAUL GILLIAM
2006-05-12 20:33 ` Mark Kettenis
3 siblings, 1 reply; 8+ messages in thread
From: Fred Fish @ 2006-05-11 14:39 UTC (permalink / raw)
To: gdb-patches
On Thursday 11 May 2006 07:09, Fred Fish wrote:
> If we care about testing for cruft between the exit message and the
> gdb prompt, to specifically catch that case, then I think that should
> have it's own dedicated testcase, which I'm happy to write and submit.
I modified the a2-run.exp test to allow it to run the part of the test that
doesn't require being able to pass arguments, and detect spurious output
after the program exits normally. Patch below.
-Fred
2006-05-11 Fred Fish <fnf@specifix.com>
* gdb.base/a2-run.exp: Allow part of test to run when args aren't
required. Check for spurious output after program exits normally.
Index: gdb.base/a2-run.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/a2-run.exp,v
retrieving revision 1.5
diff -c -p -r1.5 a2-run.exp
*** gdb.base/a2-run.exp 7 May 2002 00:45:44 -0000 1.5
--- gdb.base/a2-run.exp 11 May 2006 14:37:50 -0000
***************
*** 20,32 ****
# This file was written by Rob Savoye. (rob@cygnus.com)
- # These tests don't work for targets can't take arguments...
-
- if [target_info exists noargs] then {
- verbose "Skipping a2-run.exp because of noargs."
- return
- }
-
# Can't do this test without stdio support.
if [gdb_skip_stdio_test "a2run.exp"] {
return
--- 20,25 ----
*************** if [istarget "*-*-vxworks*"] then {
*** 77,87 ****
--- 70,90 ----
gdb_expect -re "$gdb_prompt $" {}
} else {
gdb_expect {
+ -re ".*usage: factorial <number>.*Program exited with code 01\.\r\n$gdb_prompt $" {
+ pass "run \"$testfile\" with no args"
+ pass "no spurious messages at program exit"
+ }
-re ".*usage: factorial <number>.*Program exited with code 01.*$gdb_prompt $" {
pass "run \"$testfile\" with no args"
+ fail "no spurious messages at program exit"
+ }
+ -re ".*usage: factorial <number>.* EXIT code 1.*Program exited normally\.\r\n$gdb_prompt $" {
+ pass "run \"$testfile\" with no args (exit wrapper)"
+ pass "no spurious messages at program exit"
}
-re ".*usage: factorial <number>.* EXIT code 1.*Program exited normally.*$gdb_prompt $" {
pass "run \"$testfile\" with no args (exit wrapper)"
+ fail "no spurious messages at program exit"
}
-re ".*$gdb_prompt $" {
fail "run \"$testfile\" with no args"
*************** if [istarget "*-*-vxworks*"] then {
*** 92,97 ****
--- 95,108 ----
}
}
}
+
+ # The remaining tests don't work for targets can't take arguments...
+
+ if [target_info exists noargs] then {
+ verbose "Skipping rest of a2-run.exp because of noargs."
+ return
+ }
+
# Now run with some arguments
if [istarget "*-*-vxworks*"] then {
send_gdb "run vxmain \"5\"\n"
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [RFA] Handle output after 'Program exited normally' consistently (detect spurious output)
2006-05-11 14:39 ` [RFA] Handle output after 'Program exited normally' consistently (detect spurious output) Fred Fish
@ 2006-05-15 15:57 ` Daniel Jacobowitz
2006-05-18 0:07 ` Fred Fish
0 siblings, 1 reply; 8+ messages in thread
From: Daniel Jacobowitz @ 2006-05-15 15:57 UTC (permalink / raw)
To: Fred Fish; +Cc: gdb-patches
On Thu, May 11, 2006 at 10:39:54AM -0400, Fred Fish wrote:
> On Thursday 11 May 2006 07:09, Fred Fish wrote:
> > If we care about testing for cruft between the exit message and the
> > gdb prompt, to specifically catch that case, then I think that should
> > have it's own dedicated testcase, which I'm happy to write and submit.
>
> I modified the a2-run.exp test to allow it to run the part of the test that
> doesn't require being able to pass arguments, and detect spurious output
> after the program exits normally. Patch below.
>
> -Fred
>
> 2006-05-11 Fred Fish <fnf@specifix.com>
>
> * gdb.base/a2-run.exp: Allow part of test to run when args aren't
> required. Check for spurious output after program exits normally.
I think this is OK. Does this show up the bug that you were working
around elsewhere?
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFA] Handle output after 'Program exited normally' consistently (detect spurious output)
2006-05-15 15:57 ` Daniel Jacobowitz
@ 2006-05-18 0:07 ` Fred Fish
2006-05-18 3:15 ` Daniel Jacobowitz
0 siblings, 1 reply; 8+ messages in thread
From: Fred Fish @ 2006-05-18 0:07 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches
On Monday 15 May 2006 11:55, Daniel Jacobowitz wrote:
> I think this is OK. Does this show up the bug that you were working
> around elsewhere?
Yes, the intention is to check for spurious output in one place, while
allowing it in places where we are testing for other things.
-Fred
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFA] Handle output after 'Program exited normally' consistently (detect spurious output)
2006-05-18 0:07 ` Fred Fish
@ 2006-05-18 3:15 ` Daniel Jacobowitz
0 siblings, 0 replies; 8+ messages in thread
From: Daniel Jacobowitz @ 2006-05-18 3:15 UTC (permalink / raw)
To: Fred Fish; +Cc: gdb-patches
On Wed, May 17, 2006 at 08:05:03PM -0400, Fred Fish wrote:
> On Monday 15 May 2006 11:55, Daniel Jacobowitz wrote:
> > I think this is OK. Does this show up the bug that you were working
> > around elsewhere?
>
> Yes, the intention is to check for spurious output in one place, while
> allowing it in places where we are testing for other things.
OK to check in, then.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFA] Handle output after 'Program exited normally' consistently
2006-05-11 11:08 [RFA] Handle output after 'Program exited normally' consistently Fred Fish
2006-05-11 12:39 ` Daniel Jacobowitz
2006-05-11 14:39 ` [RFA] Handle output after 'Program exited normally' consistently (detect spurious output) Fred Fish
@ 2006-05-11 17:34 ` PAUL GILLIAM
2006-05-12 20:33 ` Mark Kettenis
3 siblings, 0 replies; 8+ messages in thread
From: PAUL GILLIAM @ 2006-05-11 17:34 UTC (permalink / raw)
To: fnf; +Cc: gdb-patches
On Thu, 2006-05-11 at 07:09 -0400, Fred Fish wrote:
> There are 21 places in the current gdb testsuite where the testsuite checks
> for 'Program exited normally' followed by a gdb prompt. All of them, with
> the exception of a couple, use a test like:
>
> -re ".*Program exited normally.*$gdb_prompt $" {
>
If something is done the same way in 21 places, why not put it in
lib/gdb.exp?
-=# Paul #=-
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [RFA] Handle output after 'Program exited normally' consistently
2006-05-11 11:08 [RFA] Handle output after 'Program exited normally' consistently Fred Fish
` (2 preceding siblings ...)
2006-05-11 17:34 ` [RFA] Handle output after 'Program exited normally' consistently PAUL GILLIAM
@ 2006-05-12 20:33 ` Mark Kettenis
3 siblings, 0 replies; 8+ messages in thread
From: Mark Kettenis @ 2006-05-12 20:33 UTC (permalink / raw)
To: fnf; +Cc: gdb-patches, fnf
> From: Fred Fish <fnf@specifix.com>
> Date: Thu, 11 May 2006 07:09:11 -0400
>
> Current the bang.exp test is failing when run in the mips-elf simulator
> because of some output between the message and the prompt:
>
> Program exited normally.
> Current language: auto; currently asm
> (gdb)
Isn't this a bug of some sort?
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2006-05-18 1:35 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-11 11:08 [RFA] Handle output after 'Program exited normally' consistently Fred Fish
2006-05-11 12:39 ` Daniel Jacobowitz
2006-05-11 14:39 ` [RFA] Handle output after 'Program exited normally' consistently (detect spurious output) Fred Fish
2006-05-15 15:57 ` Daniel Jacobowitz
2006-05-18 0:07 ` Fred Fish
2006-05-18 3:15 ` Daniel Jacobowitz
2006-05-11 17:34 ` [RFA] Handle output after 'Program exited normally' consistently PAUL GILLIAM
2006-05-12 20:33 ` Mark Kettenis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox