]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdbserver: add process specific thread list and map
authorStephan Rohr <stephan.rohr@intel.com>
Tue, 22 Oct 2024 14:01:19 +0000 (07:01 -0700)
committerStephan Rohr <stephan.rohr@intel.com>
Thu, 7 Nov 2024 10:50:48 +0000 (02:50 -0800)
commitc26f8fbe794cf2fb4c4a1fdefeae32137d2bd303
treecd84afa0b66ec282de7f7f8f8a736ea6e5df98d2
parent9f77b3aa0bfcd07015a47aef210fdc1157a4f08f
gdbserver: add process specific thread list and map

Replace the servers global thread list with a process specific thread
list and a ptid -> thread map similar to 'inferior::ptid_thread_map' on
GDB side.  Optimize the 'find_thread' and 'find_thread_ptid' functions
to use std::unordered_map::find for faster lookup of threads without
iterating over all processes and threads, if applicable.  This becomes
important when debugging applications with a large thread count, e.g.,
in the context of GPU debugging.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
gdbserver/gdbthread.h
gdbserver/inferiors.cc
gdbserver/inferiors.h
gdbserver/server.cc