aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2023-08-14 13:38:42 -0700
committerJohn Baldwin <jhb@FreeBSD.org>2023-08-14 13:38:42 -0700
commit12e5b10965ccfc5fe42bd129c158280cd6e834a7 (patch)
tree325e3fde9c1db0557c4441385c1bfca6a350b208 /gdb/testsuite/gdb.python
parenta6f51542941e072d942fc8df7353bd10097974ea (diff)
downloadbinutils-12e5b10965ccfc5fe42bd129c158280cd6e834a7.zip
binutils-12e5b10965ccfc5fe42bd129c158280cd6e834a7.tar.gz
binutils-12e5b10965ccfc5fe42bd129c158280cd6e834a7.tar.bz2
fbsd-nat: Fix resuming and waiting with multiple processes.
I did not fully understand the requirements of multiple process support when I enabled it previously and several parts were broken. In particular, the resume method was only resuming a single process, and wait was not stopping other processes when reporting an event. To support multiple running inferiors, add a new per-inferior structure which trackes the number of existing and running LWPs for each process. The structure also stores a ptid_t describing the set of LWPs currently resumed for each process. For the resume method, iterate over all non-exited inferiors resuming each process matching the passed in ptid rather than only resuming the current inferior's process for a wildcard ptid. If a resumed process has a pending event, don't actually resume the process, but other matching processes without a pending event are still resumed in case the later call to the wait method requests an event from one of the processes without a pending event. For the wait method, stop other running processes before returning an event to the core. When stopping a process, first check to see if an event is already pending. If it is, queue the event to be reported later. If not, send a SIGSTOP to the process and wait for it to stop. If the event reported by the wait is not for the SIGSTOP, queue the event and remember to ignore a future SIGSTOP event for the process. Note that, unlike the Linux native target, entire processes are stopped rather than individual LWPs. In FreeBSD one can only wait on processes (via pid), not for an event from a specific thread. Other changes in this commit handle bookkeeping for the per-inferior data such as migrating the data to the new inferior in the follow_exec method. The per-inferior data is created in the attach, create_inferior, and follow_fork methods.
Diffstat (limited to 'gdb/testsuite/gdb.python')
0 files changed, 0 insertions, 0 deletions