aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorPedro Alves <pedro@palves.net>2023-11-21 12:23:11 +0000
committerPedro Alves <pedro@palves.net>2023-12-20 21:18:20 +0000
commit4ea7412e53616ecc29d61a95ff8afc284ed9d240 (patch)
tree82c6c90894926874374ab311813b05cdb2a73bd4 /gdb/python
parentaed77b16f17fc3ed9c952af632674dc25d0dfdb5 (diff)
downloadbinutils-4ea7412e53616ecc29d61a95ff8afc284ed9d240.zip
binutils-4ea7412e53616ecc29d61a95ff8afc284ed9d240.tar.gz
binutils-4ea7412e53616ecc29d61a95ff8afc284ed9d240.tar.bz2
gdb.threads/step-over-thread-exit.exp improvements
This commit makes the following improvements to gdb.threads/step-over-thread-exit.exp: - Add a third axis to stepping over the breakpoint with displaced vs inline stepping -- also test with no breakpoint at all. - Check that when GDB reports "Command aborted, thread exited.", the selected thread is the thread that exited. This is always true currently on GNU/Linux by coincidence, but a similar testcase on AMD GPU exposed a problem here. Better make the testcase catch any potential regression. - Fixes a race that Simon ran into with GDBserver testing. (gdb) next [New Thread 2143071.2143438] Thread 3 "step-over-threa" hit Breakpoint 2, 0x000055555555524e in my_exit_syscall () at .../testsuite/lib/my-syscalls.S:74 74 SYSCALL (my_exit, __NR_exit) (gdb) FAIL: gdb.threads/step-over-thread-exit.exp: displaced-stepping=auto: non-stop=on: target-non-stop=on: schedlock=off: cmd=next: ns_stop_all=0: command aborts when thread exits I was not able to reproduce it, but I believe that what happens is the following: Once we continue, the thread 2 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 the failure seen above. The fix here is to not loop and start a new thread at all in the scenario where the race can happen. We only need to loop and spawn new threads when testing with "cmd=continue" and schedlock off, in which case GDB doesn't abort the command when the thread exits. Approved-By: Simon Marchi <simon.marchi@efficios.com> Change-Id: I90c95c32f00630a3f682b1541c23aff52451f9b6
Diffstat (limited to 'gdb/python')
0 files changed, 0 insertions, 0 deletions