aboutsummaryrefslogtreecommitdiff
path: root/gdb/ui-file.c
diff options
context:
space:
mode:
authorPedro Alves <pedro@palves.net>2022-03-28 18:35:34 +0100
committerPedro Alves <pedro@palves.net>2022-04-14 20:22:56 +0100
commit421490af33bfbfe8a8429f0e43fb3e9f8727476e (patch)
treed6a5ec2d36574605c40b8ef69bcc791ecc59056d /gdb/ui-file.c
parent366e3746c572c2c78454761e62fa9181cba413ca (diff)
downloadbinutils-421490af33bfbfe8a8429f0e43fb3e9f8727476e.zip
binutils-421490af33bfbfe8a8429f0e43fb3e9f8727476e.tar.gz
binutils-421490af33bfbfe8a8429f0e43fb3e9f8727476e.tar.bz2
gdbserver/linux: Access memory even if threads are running
Similarly to how the native Linux target was changed and subsequently reworked in these commits: 05c06f318fd9 Linux: Access memory even if threads are running 8a89ddbda2ec Avoid /proc/pid/mem races (PR 28065) ... teach GDBserver to access memory even when the current thread is running, by always accessing memory via /proc/PID/mem. The existing comment: /* Neither ptrace nor /proc/PID/mem allow accessing memory through a running LWP. */ ... is incorrect for /proc/PID/mem does allow that. Actually, from GDB's perspective, GDBserver could already access memory while threads were running, but at the expense of pausing all threads for the duration of the memory access, via prepare_to_access_memory. This new implementation does not require pausing any thread, thus linux_process_target::prepare_to_access_memory / linux_process_target::done_accessing_memory become nops. A subsequent patch will remove the whole prepare_to_access_memory infrastructure completely. The GDBserver linux-low.cc implementation is simpler than GDB's linux-nat.c's, because GDBserver always adds the unfollowed vfork/fork children to the process list immediately when the fork/vfork event is seen out of ptrace. I.e., there's no need to keep the file descriptor stored on a side map, we can store it directly in the process structure. Change-Id: I0abfd782ceaa4ddce8d3e5f3e2dfc5928862ef61
Diffstat (limited to 'gdb/ui-file.c')
0 files changed, 0 insertions, 0 deletions