]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdbserver: move_out_of_jump_pad_callback misses switching current thread
authorPedro Alves <palves@redhat.com>
Thu, 6 Aug 2015 14:02:26 +0000 (15:02 +0100)
committerPedro Alves <palves@redhat.com>
Thu, 6 Aug 2015 14:02:26 +0000 (15:02 +0100)
commita01c46276aa3a16c2ac1dae249df14e39d1c281f
tree8094ecbac85545d4f57266fd091c1a69585f56ba
parent4ede28ca86b7206859a965cfaf2b13236f2de752
gdbserver: move_out_of_jump_pad_callback misses switching current thread

While hacking on the fix for PR threads/18600 (Threads left stopped
after fork+thread spawn), I once saw its test (fork-plus-threads.exp)
FAIL against gdbserver because move_out_of_jump_pad_callback has a
gdb_breakpoint_here call, and the caller isn't making sure the current
thread points to the right thread.  In the case I saw, the current
thread pointed to the wrong process, so gdb_breakpoint_here returned
the wrong answer.  Unfortunately I didn't save logs.  Still, seems
obvious enough and it should fix a potential occasional racy FAIL.

Tested on x86_64 Fedora 20.

gdb/gdbserver/ChangeLog:
2015-08-06  Pedro Alves  <palves@redhat.com>

* linux-low.c (move_out_of_jump_pad_callback): Temporarily switch
the current thread.
gdb/gdbserver/ChangeLog
gdb/gdbserver/linux-low.c