Skip to content
Commit 922cc93d authored by Simon Marchi's avatar Simon Marchi
Browse files

gdb: maintain ptid -> thread map, optimize find_thread_ptid



When debugging a large number of threads (thousands), looking up a
thread by ptid_t using the inferior::thread_list linked list can add up.

Add inferior::thread_map, an std::unordered_map indexed by ptid_t, and
change the find_thread_ptid function to look up a thread using
std::unordered_map::find, instead of iterating on all of the
inferior's threads.  This should make it faster to look up a thread
from its ptid.

Change-Id: I3a8da0a839e18dee5bb98b8b7dbeb7f3dfa8ae1c
Co-Authored-By: default avatarPedro Alves <pedro@palves.net>
parent 71a23490
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment