You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[lldb] Add APIs enabling OperatingSystem plugins to update ThreadPlanStack
At the end of Process::UpdateThreadListIfNeeded, we see this comment:
```
// Now update the plan stack map.
// If we do have an OS plugin, any absent real threads in the
// m_thread_list have already been removed from the ThreadPlanStackMap.
// So any remaining threads are OS Plugin threads, and those we want to
// preserve in case they show up again.
m_thread_plans.Update(m_thread_list, clear_unused_threads);
```
In other words, if a OS plugin maps a real thread to a plugin thread,
the plugin is expected to remove the thread plan of the real thread from
`m_thread_plans`.
However, it is impossible to do so today: the APIs are simply not there.
In fact, plugins don't even have access to `m_thread_plans`. This is not
a problem for plugins who "report all threads", since LLDB will then
clean up plans for any threads that are not present in the new list of
threads (mapped real threads won't be in the new list). For plugins that
do _not_ report all threads, this is a problem.
There are two pieces missing here:
A) The `OperatingSystem::UpdateThreadList` function needs access to
m_thread_plans.
B) ThreadPlanStack needs to expose the TIDs it currently knows about,
since its methods (like Find, Erase) are all TID-based.
This commit provides these pieces so that future commits (and plugins)
may make use of them.
Point A is currently addressed by passing m_thread_plans as a function
argument to OperatingSystem::UpdateThreadList, however it would have
been possible to make it public through an accessor method in Process.
0 commit comments