diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2024-11-07 16:16:59 +0000 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2024-11-08 09:16:23 -0500 |
commit | dceb3cd436e0240857ff914d3f11872a78d0c63c (patch) | |
tree | 0b5e9e1078f1ad8d0e5a7fa10b7ee4adedfd42ce /gdbserver/inferiors.cc | |
parent | 3470a0e144df6c01f8479fa649f43aa907936e7e (diff) | |
download | gdb-dceb3cd436e0240857ff914d3f11872a78d0c63c.zip gdb-dceb3cd436e0240857ff914d3f11872a78d0c63c.tar.gz gdb-dceb3cd436e0240857ff914d3f11872a78d0c63c.tar.bz2 |
gdbserver: add thread -> process backlink
In a few spots, we need to get to a process from a thread. Having a
backlink from thread to process is cheap and makes the operation
trivial, add it.
Change-Id: I8a94b2919494b1dcaf954de2246386794308aa82
Reviewed-By: Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Diffstat (limited to 'gdbserver/inferiors.cc')
-rw-r--r-- | gdbserver/inferiors.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdbserver/inferiors.cc b/gdbserver/inferiors.cc index 93555ec..d447808 100644 --- a/gdbserver/inferiors.cc +++ b/gdbserver/inferiors.cc @@ -44,8 +44,8 @@ add_thread (ptid_t thread_id, void *target_data) process_info *process = find_process_pid (thread_id.pid ()); gdb_assert (process != nullptr); - auto &new_thread = process->thread_list ().emplace_back (thread_id, - target_data); + auto &new_thread + = process->thread_list ().emplace_back (thread_id, process, target_data); bool inserted = process->thread_map ().insert ({thread_id, &new_thread}).second; |