]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/testsuite/ChangeLog
gdb/testsuite: fix race in gdb.threads/signal-while-stepping-over-bp-other-thread.exp
authorSimon Marchi <simon.marchi@polymtl.ca>
Wed, 6 Jan 2021 15:53:22 +0000 (10:53 -0500)
committerSimon Marchi <simon.marchi@polymtl.ca>
Wed, 6 Jan 2021 15:53:22 +0000 (10:53 -0500)
commit3c55062cc1d8fdb6788164a55c1e4b773c781985
tree495de5c3152a76bc38cc44a018c86e0c4cf8e4d7
parent4b186f88b816851dca198fc523eba4b53d4c1e5e
gdb/testsuite: fix race in gdb.threads/signal-while-stepping-over-bp-other-thread.exp

Commit 3ec3145c5dd6 ("gdb: introduce scoped debug prints") updated some
tests using "set debug infrun" to handle the fact that a debug print is
now shown after the prompt, after an inferior stop.  The same issue
happens in gdb.threads/signal-while-stepping-over-bp-other-thread.exp.
If I run it in a loop, it eventually fails like these other tests.

The problem is that the testsuite expects to see $gdb_prompt followed by
the end of the buffer.  It happens that expect reads $gdb_prompt and the
debug print at the same time, in which case the regexp never matches and
we get a timeout.

The fix is the same as was done in 3ec3145c5dd6, make the testsuite
believe that the prompt is the standard GDB prompt followed by that
debug print.

Since that test uses gdb_test_sequence, and the expected prompt is in
gdb_test_sequence, add a -prompt switch to gdb_test_sequence to override
the prompt used for that call.

gdb/testsuite/ChangeLog:

* lib/gdb.exp (gdb_test_sequence): Accept -prompt switch.
* gdb.threads/signal-while-stepping-over-bp-other-thread.exp:
Pass prompt containing debug print to gdb_test_sequence.

Change-Id: I33161c53ddab45cdfeadfd50b964f8dc3caa9729
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.exp
gdb/testsuite/lib/gdb.exp