diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2024-11-07 16:15:43 +0000 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2024-11-08 09:16:23 -0500 |
commit | 2500e7d7d2464e461cc6b6f9ab23ea12338832f9 (patch) | |
tree | 1b10d4891519a0289c76f2c986e91c2a087bcebe /gdbserver/inferiors.cc | |
parent | 9618dbfe52fa98e224e53e18626fbe08e9c892a7 (diff) | |
download | gdb-2500e7d7d2464e461cc6b6f9ab23ea12338832f9.zip gdb-2500e7d7d2464e461cc6b6f9ab23ea12338832f9.tar.gz gdb-2500e7d7d2464e461cc6b6f9ab23ea12338832f9.tar.bz2 |
gdbserver: make remove_thread a method of process_info
Same idea as the previous patch, but for `remove_thread`.
Change-Id: I7e227655be5fcf29a3256e8389eb32051f27882d
Reviewed-By: Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Diffstat (limited to 'gdbserver/inferiors.cc')
-rw-r--r-- | gdbserver/inferiors.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/gdbserver/inferiors.cc b/gdbserver/inferiors.cc index 7d9152d..8ca6d64 100644 --- a/gdbserver/inferiors.cc +++ b/gdbserver/inferiors.cc @@ -100,23 +100,22 @@ find_any_thread_of_pid (int pid) } void -remove_thread (struct thread_info *thread) +process_info::remove_thread (thread_info *thread) { if (thread->btrace != NULL) target_disable_btrace (thread->btrace); discard_queued_stop_replies (ptid_of (thread)); - process_info *process = get_thread_process (thread); - gdb_assert (process != nullptr); if (current_thread == thread) switch_to_thread (nullptr); /* We should not try to remove a thread that was not added. */ - int num_erased = process->thread_map ().erase (thread->id); + gdb_assert (thread->process () == this); + int num_erased = m_ptid_thread_map.erase (thread->id); gdb_assert (num_erased > 0); - process->thread_list ().erase (process->thread_list ().iterator_to (*thread)); + m_thread_list.erase (m_thread_list.iterator_to (*thread)); } void * |