aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <pedro@palves.net>2023-11-13 16:30:31 +0000
committerPedro Alves <pedro@palves.net>2023-11-13 16:57:48 +0000
commit634092d3882c9b6c57fcfae1dd6d35ccbf17b854 (patch)
tree3ce9a116383730f26ea33d205d706a4afeee26b3
parentb0dfd7427be1c022581ea4ff33713e9922294c34 (diff)
downloadgdb-users/palves/step-over-thread-exit-test-race.zip
gdb-users/palves/step-over-thread-exit-test-race.tar.gz
gdb-users/palves/step-over-thread-exit-test-race.tar.bz2
Fix gdb.threads/step-over-thread-exit.exp raceusers/palves/step-over-thread-exit-test-race
Change-Id: I9d0a6fab069a02ac5557525b93b129940dbd4bf7
-rw-r--r--gdb/testsuite/gdb.threads/step-over-thread-exit.exp10
1 files changed, 10 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.threads/step-over-thread-exit.exp b/gdb/testsuite/gdb.threads/step-over-thread-exit.exp
index 615bd83..19723e7 100644
--- a/gdb/testsuite/gdb.threads/step-over-thread-exit.exp
+++ b/gdb/testsuite/gdb.threads/step-over-thread-exit.exp
@@ -96,6 +96,16 @@ proc test {displaced-stepping non-stop target-non-stop schedlock cmd ns_stop_all
if {${non-stop}} {
gdb_test -nopass "thread $thread" "Switching to thread .*" \
"switch to event thread"
+
+ # Once we continue, the current thread exits, and the
+ # main thread thus unblocks from its pthread_join, and
+ # spawns a new thread. That new thread may hit the
+ # breakpoint at my_exit_syscall very quickly. GDB
+ # could then see/process that breakpoint event before
+ # the thread exit event for the thread we care about,
+ # which would result in a failure in the test below.
+ # Just delete the breakpoint to avoid it.
+ delete_breakpoints
}
gdb_test_multiple $cmd "command aborts when thread exits" {