Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lldb] Add APIs enabling OperatingSystem plugins to update ThreadPlanStack #122966

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lldb/include/lldb/Target/OperatingSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "lldb/lldb-private.h"

namespace lldb_private {
class ThreadPlanStackMap;

/// \class OperatingSystem OperatingSystem.h "lldb/Target/OperatingSystem.h"
/// A plug-in interface definition class for halted OS helpers.
Expand Down Expand Up @@ -45,7 +46,8 @@ class OperatingSystem : public PluginInterface {
// Plug-in Methods
virtual bool UpdateThreadList(ThreadList &old_thread_list,
ThreadList &real_thread_list,
ThreadList &new_thread_list) = 0;
ThreadList &new_thread_list,
ThreadPlanStackMap &plan_stack_map) = 0;

virtual void ThreadWasSelected(Thread *thread) = 0;

Expand Down
7 changes: 7 additions & 0 deletions lldb/include/lldb/Target/ThreadPlanStack.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,13 @@ class ThreadPlanStackMap {

bool PrunePlansForTID(lldb::tid_t tid);

std::vector<lldb::tid_t> GetKnownTIDs() const {
std::vector<lldb::tid_t> TIDs;
for (auto &plan_stack : m_plans_up_container)
TIDs.push_back(plan_stack->GetTID());
return TIDs;
}

private:
Process &m_process;
mutable std::recursive_mutex m_stack_map_mutex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ DynamicRegisterInfo *OperatingSystemPython::GetDynamicRegisterInfo() {

bool OperatingSystemPython::UpdateThreadList(ThreadList &old_thread_list,
ThreadList &core_thread_list,
ThreadList &new_thread_list) {
ThreadList &new_thread_list,
ThreadPlanStackMap &) {
if (!m_interpreter || !m_operating_system_interface_sp)
return false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ class OperatingSystemPython : public lldb_private::OperatingSystem {
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }

// lldb_private::OperatingSystem Methods
bool UpdateThreadList(lldb_private::ThreadList &old_thread_list,
lldb_private::ThreadList &real_thread_list,
lldb_private::ThreadList &new_thread_list) override;
bool
UpdateThreadList(lldb_private::ThreadList &old_thread_list,
lldb_private::ThreadList &real_thread_list,
lldb_private::ThreadList &new_thread_list,
lldb_private::ThreadPlanStackMap &plan_stack_map) override;

void ThreadWasSelected(lldb_private::Thread *thread) override;

Expand Down
3 changes: 2 additions & 1 deletion lldb/source/Target/Process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1202,8 +1202,9 @@ void Process::UpdateThreadListIfNeeded() {
real_thread_list, // The actual thread list full of threads
// created by each lldb_private::Process
// subclass
new_thread_list); // The new thread list that we will show to the
new_thread_list, // The new thread list that we will show to the
// user that gets filled in
m_thread_plans);

if (saved_prefer_dynamic != lldb::eNoDynamicValues)
target.SetPreferDynamicValue(saved_prefer_dynamic);
Expand Down
Loading