Flipping ifelse.exp test
Andrew STUBBS
andrew.stubbs@st.com
Tue Jul 18 15:24:00 GMT 2006
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
More information about the Gdb
mailing list