struct thread_info : public intrusive_list_node<thread_info>
{
- thread_info (ptid_t id, void *target_data)
- : id (id), target_data (target_data)
+ thread_info (ptid_t id, process_info *process, void *target_data)
+ : id (id), target_data (target_data), m_process (process)
{}
~thread_info ()
free_register_cache (this->regcache_data);
}
+ /* Return the process owning this thread. */
+ process_info *process () const
+ { return m_process; }
+
/* The id of this thread. */
ptid_t id;
/* Thread options GDB requested with QThreadOptions. */
gdb_thread_options thread_options = 0;
+
+private:
+ process_info *m_process;
};
void remove_thread (struct thread_info *thread);
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;