process-dies-while-detaching.exp: Exit early if GDB misses sync breakpoint
authorThiago Jung Bauermann <thiago.bauermann@linaro.org>
Thu, 28 Sep 2023 11:17:54 +0000 (08:17 -0300)
committerThiago Jung Bauermann <thiago.bauermann@linaro.org>
Fri, 6 Oct 2023 20:36:42 +0000 (17:36 -0300)
commit0f3efefb34f83236ec7d780747103a0b4f3fb6b1
tree81b304952f0c70f43817f8592ed8161ba864d1b7
parent6bbf249557ba17cfebe01c67370df4da9e6a56f9
process-dies-while-detaching.exp: Exit early if GDB misses sync breakpoint

I'm seeing a lot of variability in the failures of
gdb.threads/process-dies-while-detaching.exp on aarch64-linux.  On this
platform, a problem yet to be investigated causes GDB to miss the _exit
breakpoint.  What happens next is random because after missing that
breakpoint, GDB is out of sync with the inferior.  This causes the tests
following that point in the testcase to fail in a random way.

In this scenario it's better to exit the testcase early to avoid random
results in the testsuite.

We are relying on gdb_continue_to_breakpoint to return the result of
gdb_test_multiple.  This is already the case because in Tcl the return
value of a function is the return value of the last command it runs.  But
change gdb_continue_to_breakpoint to explicitly return this value, to make
it clear this is the intended behaviour.

Tested on aarch64-linux.

Tested-By: Guinevere Larsen <blarsen@redhat.com>
Approved-By: Andrew Burgess <aburgess@redhat.com>
gdb/testsuite/gdb.threads/process-dies-while-detaching.exp
gdb/testsuite/lib/gdb.exp