Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Flipping ifelse.exp test
@ 2006-07-17 23:32 Mark Kettenis
  2006-07-18  7:24 ` Daniel Jacobowitz
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Kettenis @ 2006-07-17 23:32 UTC (permalink / raw)
  To: gdb

Hi folks,

I sometimes see the following failure:

FAIL: gdb.base/ifelse.exp: if 1 with empty body

If everything is all right, the output in gdb.log looks like:

(gdb) if 1
 >end
(gdb) echo got here\n
got here
(gdb) PASS: gdb.base/ifelse.exp: if 1 with empty body

but when it fails, it looks like:

(gdb) if 1
 >end
(gdb) FAIL: gdb.base/ifelse.exp: if 1 with empty body
echo got here\n
got here
(gdb) PASS: gdb.base/ifelse.exp: if 0 with empty body

I fail to see what's wrong with the test though.  The regular
expressions seem to be properly anchored.

Can anyone spot the problem?

Mark


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

* Re: Flipping ifelse.exp test
  2006-07-17 23:32 Flipping ifelse.exp test Mark Kettenis
@ 2006-07-18  7:24 ` Daniel Jacobowitz
  2006-07-18 15:24   ` Andrew STUBBS
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2006-07-18  7:24 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb

On Tue, Jul 18, 2006 at 01:02:48AM +0200, Mark Kettenis wrote:
> 
> (gdb) if 1
>  >end
> (gdb) FAIL: gdb.base/ifelse.exp: if 1 with empty body
> echo got here\n
> got here
> (gdb) PASS: gdb.base/ifelse.exp: if 0 with empty body
> 
> I fail to see what's wrong with the test though.  The regular
> expressions seem to be properly anchored.
> 
> Can anyone spot the problem?

Yes.  The default pattern in gdb_test_multiple is anchored by
"$gdb_prompt $", which occurs (if you're unlucky with buffering)
right in the middle of this test.

Basically you can't do a test that requires two gdb prompts.
I'd recommend removing the "echo got_here" from that test and the other
similar ones.  Another thing that might work would be an explicit
anchored pattern to catch the first gdb prompt and continue, below the
pass pattern, but that's prone to timeouts if something goes wrong..

-- 
Daniel Jacobowitz
CodeSourcery


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

* Re: Flipping ifelse.exp test
  2006-07-18  7:24 ` Daniel Jacobowitz
@ 2006-07-18 15:24   ` Andrew STUBBS
  2006-07-18 17:59     ` Mark Kettenis
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew STUBBS @ 2006-07-18 15:24 UTC (permalink / raw)
  To: Mark Kettenis, gdb

Daniel Jacobowitz wrote:
> On Tue, Jul 18, 2006 at 01:02:48AM +0200, Mark Kettenis wrote:
>> (gdb) if 1
>>  >end
>> (gdb) FAIL: gdb.base/ifelse.exp: if 1 with empty body
>> echo got here\n
>> got here
>> (gdb) PASS: gdb.base/ifelse.exp: if 0 with empty body
>>
>> I fail to see what's wrong with the test though.  The regular
>> expressions seem to be properly anchored.
>>
>> Can anyone spot the problem?
> 
> Yes.  The default pattern in gdb_test_multiple is anchored by
> "$gdb_prompt $", which occurs (if you're unlucky with buffering)
> right in the middle of this test.
> 
> Basically you can't do a test that requires two gdb prompts.
> I'd recommend removing the "echo got_here" from that test and the other
> similar ones.  Another thing that might work would be an explicit
> anchored pattern to catch the first gdb prompt and continue, below the
> pass pattern, but that's prone to timeouts if something goes wrong..
> 

Hmmm, the point of the 'got here' was to ensure that GDB hadn't died 
horribly, and that it was still capable of running commands. I think the 
problem was that there is no output from the actual statement being 
tested. That was with the original script I had. Perhaps now it is 
implemented with gdb_test_multiple the prompt is enough.

A slightly wackier alternative might be to change the GDB prompt for 
this test.

Andrew


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

* Re: Flipping ifelse.exp test
  2006-07-18 15:24   ` Andrew STUBBS
@ 2006-07-18 17:59     ` Mark Kettenis
  2006-07-18 18:35       ` Daniel Jacobowitz
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Kettenis @ 2006-07-18 17:59 UTC (permalink / raw)
  To: andrew.stubbs; +Cc: gdb

> Date: Tue, 18 Jul 2006 10:31:40 +0100
> From: Andrew STUBBS <andrew.stubbs@st.com>
> 
> Hmmm, the point of the 'got here' was to ensure that GDB hadn't died 
> horribly, and that it was still capable of running commands. I think the 
> problem was that there is no output from the actual statement being 
> tested. That was with the original script I had. Perhaps now it is 
> implemented with gdb_test_multiple the prompt is enough.

I think it is.  Worst case, you'll get timeouts when things break
again.  Hopefully those will be annoying enough that things get fixed
again soon ;-).

Mark


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

* Re: Flipping ifelse.exp test
  2006-07-18 17:59     ` Mark Kettenis
@ 2006-07-18 18:35       ` Daniel Jacobowitz
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Jacobowitz @ 2006-07-18 18:35 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: andrew.stubbs, gdb

On Tue, Jul 18, 2006 at 07:58:31PM +0200, Mark Kettenis wrote:
> > Date: Tue, 18 Jul 2006 10:31:40 +0100
> > From: Andrew STUBBS <andrew.stubbs@st.com>
> > 
> > Hmmm, the point of the 'got here' was to ensure that GDB hadn't died 
> > horribly, and that it was still capable of running commands. I think the 
> > problem was that there is no output from the actual statement being 
> > tested. That was with the original script I had. Perhaps now it is 
> > implemented with gdb_test_multiple the prompt is enough.
> 
> I think it is.  Worst case, you'll get timeouts when things break
> again.  Hopefully those will be annoying enough that things get fixed
> again soon ;-).

Yeah, I agree.

-- 
Daniel Jacobowitz
CodeSourcery


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

end of thread, other threads:[~2006-07-18 17:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-17 23:32 Flipping ifelse.exp test Mark Kettenis
2006-07-18  7:24 ` Daniel Jacobowitz
2006-07-18 15:24   ` Andrew STUBBS
2006-07-18 17:59     ` Mark Kettenis
2006-07-18 18:35       ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox