aboutsummaryrefslogtreecommitdiff
path: root/install-sh
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2015-11-30 16:05:26 +0000
committerPedro Alves <palves@redhat.com>2015-11-30 18:44:51 +0000
commita67a9faef0e32886c83611cc7a0ba61e91123063 (patch)
tree77dcebf790baccc6f857afc13da9ee36ada47a76 /install-sh
parentf2faf941ae49653ff6e1485adfee299313d47c91 (diff)
downloadgdb-a67a9faef0e32886c83611cc7a0ba61e91123063.zip
gdb-a67a9faef0e32886c83611cc7a0ba61e91123063.tar.gz
gdb-a67a9faef0e32886c83611cc7a0ba61e91123063.tar.bz2
gdbserver:prepare_access_memory: pick another thread
Say GDB wants to access the inferior process's memory. The current remote general thread is 3, but GDB's switched to thread 2. Because both threads are of the same process, GDB skips making the remote thread be thread 2 as well (sending an Hg packet) before accessing memory (remote.c:set_general_process). However, if thread 3 has exited meanwhile, thread 3 no longer exists on the server and gdbserver points current_thread to NULL. The result is the memory access fails, even through the process still exists. Fix this by making prepare_to_access memory select the thread to access memory through. gdb/gdbserver/ChangeLog: 2015-11-30 Pedro Alves <palves@redhat.com> * mem-break.c (check_gdb_bp_preconditions): Remove current_thread check. (set_gdb_breakpoint): If prepare_to_access_memory fails, set *ERR to -1. * target.c (struct thread_search): New structure. (thread_search_callback): New function. (prev_general_thread): New global. (prepare_to_access_memory, done_accessing_memory): New functions. * target.h (prepare_to_access_memory, done_accessing_memory): Replace macros with function declarations.
Diffstat (limited to 'install-sh')
0 files changed, 0 insertions, 0 deletions