Re: [PATCH] gdb.base/setshow.exp: fix racy tests (PR testsuite/12649)

Marek Polacek
2011-04-19T13:21:26Z

On 04/19/2011 02:52 PM, Tom Tromey wrote:
> Maybe gdb.log says something, or maybe running with --verbose would
> help.

The `runtest -v -v -v gdb.base/setshow.exp' says this:

Looking to match ""[\r\n]*(Input and output radices now set to decimal 16, hex
10, octal 20..*)[\r\n]+\(gdb\) $"; "(^FOOBAR$)$""

Note those '\' around (gdb). This is probably the reason why we need to supply
"\\".

> Also, looking at the code, it seems to me that the section that sets the
> prompt to "(FooBarBaz) " should also set and restore gdb_prompt. That
> is because gdb_test_multiple references this. What do you think?

The prompt is restored by the gdb_test_multiple "set prompt \\(gdb\\) ".
Then it is checked by the -re "$gdb_prompt $". I think this is correct.

Marek