LLDB mainline
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
lldb_private::ThreadPlanStack Class Reference

#include <ThreadPlanStack.h>

Public Types

using PlanStack = std::vector< lldb::ThreadPlanSP >
 

Public Member Functions

 ThreadPlanStack (const Thread &thread, bool make_empty=false)
 
 ~ThreadPlanStack ()=default
 
void DumpThreadPlans (Stream &s, lldb::DescriptionLevel desc_level, bool include_internal) const
 
size_t CheckpointCompletedPlans ()
 
void RestoreCompletedPlanCheckpoint (size_t checkpoint)
 
void DiscardCompletedPlanCheckpoint (size_t checkpoint)
 
void ThreadDestroyed (Thread *thread)
 
void PushPlan (lldb::ThreadPlanSP new_plan_sp)
 
lldb::ThreadPlanSP PopPlan ()
 
lldb::ThreadPlanSP DiscardPlan ()
 
void DiscardPlansUpToPlan (ThreadPlan *up_to_plan_ptr)
 
void DiscardAllPlans ()
 
void DiscardConsultingControllingPlans ()
 
lldb::ThreadPlanSP GetCurrentPlan () const
 
lldb::ThreadPlanSP GetCompletedPlan (bool skip_private=true) const
 
lldb::ThreadPlanSP GetPlanByIndex (uint32_t plan_idx, bool skip_private=true) const
 
lldb::ValueObjectSP GetReturnValueObject () const
 
lldb::ExpressionVariableSP GetExpressionVariable () const
 
bool AnyPlans () const
 
bool AnyCompletedPlans () const
 
bool AnyDiscardedPlans () const
 
bool IsPlanDone (ThreadPlan *plan) const
 
bool WasPlanDiscarded (ThreadPlan *plan) const
 
ThreadPlanGetPreviousPlan (ThreadPlan *current_plan) const
 
ThreadPlanGetInnermostExpression () const
 
void WillResume ()
 
void ClearThreadCache ()
 Clear the Thread* cache that each ThreadPlan contains.
 

Private Member Functions

lldb::ThreadPlanSP DiscardPlanNoLock ()
 
lldb::ThreadPlanSP GetCurrentPlanNoLock () const
 
void PrintOneStackNoLock (Stream &s, llvm::StringRef stack_name, const PlanStack &stack, lldb::DescriptionLevel desc_level, bool include_internal) const
 

Private Attributes

PlanStack m_plans
 The stack of plans this thread is executing.
 
PlanStack m_completed_plans
 Plans that have been completed by this stop.
 
PlanStack m_discarded_plans
 Plans that have been discarded by this stop.
 
size_t m_completed_plan_checkpoint = 0
 
std::unordered_map< size_t, PlanStackm_completed_plan_store
 
llvm::sys::RWMutex m_stack_mutex
 

Friends

class lldb_private::Thread
 

Detailed Description

Definition at line 33 of file ThreadPlanStack.h.

Member Typedef Documentation

◆ PlanStack

Definition at line 40 of file ThreadPlanStack.h.

Constructor & Destructor Documentation

◆ ThreadPlanStack()

ThreadPlanStack::ThreadPlanStack ( const Thread thread,
bool  make_empty = false 
)

Definition at line 30 of file ThreadPlanStack.cpp.

References m_plans.

◆ ~ThreadPlanStack()

lldb_private::ThreadPlanStack::~ThreadPlanStack ( )
default

Member Function Documentation

◆ AnyCompletedPlans()

bool ThreadPlanStack::AnyCompletedPlans ( ) const

◆ AnyDiscardedPlans()

bool ThreadPlanStack::AnyDiscardedPlans ( ) const

◆ AnyPlans()

bool ThreadPlanStack::AnyPlans ( ) const

◆ CheckpointCompletedPlans()

size_t ThreadPlanStack::CheckpointCompletedPlans ( )

◆ ClearThreadCache()

void ThreadPlanStack::ClearThreadCache ( )

Clear the Thread* cache that each ThreadPlan contains.

This is useful in situations like when a new Thread list is being generated.

Definition at line 397 of file ThreadPlanStack.cpp.

References m_plans, and m_stack_mutex.

◆ DiscardAllPlans()

void ThreadPlanStack::DiscardAllPlans ( )

◆ DiscardCompletedPlanCheckpoint()

void ThreadPlanStack::DiscardCompletedPlanCheckpoint ( size_t  checkpoint)

Definition at line 101 of file ThreadPlanStack.cpp.

References m_completed_plan_store, and m_stack_mutex.

◆ DiscardConsultingControllingPlans()

void ThreadPlanStack::DiscardConsultingControllingPlans ( )

◆ DiscardPlan()

lldb::ThreadPlanSP ThreadPlanStack::DiscardPlan ( )

Definition at line 165 of file ThreadPlanStack.cpp.

References DiscardPlanNoLock(), and m_stack_mutex.

Referenced by lldb_private::Thread::DiscardPlan().

◆ DiscardPlanNoLock()

lldb::ThreadPlanSP ThreadPlanStack::DiscardPlanNoLock ( )
private

◆ DiscardPlansUpToPlan()

void ThreadPlanStack::DiscardPlansUpToPlan ( ThreadPlan up_to_plan_ptr)

◆ DumpThreadPlans()

void ThreadPlanStack::DumpThreadPlans ( Stream s,
lldb::DescriptionLevel  desc_level,
bool  include_internal 
) const

◆ GetCompletedPlan()

lldb::ThreadPlanSP ThreadPlanStack::GetCompletedPlan ( bool  skip_private = true) const

◆ GetCurrentPlan()

lldb::ThreadPlanSP ThreadPlanStack::GetCurrentPlan ( ) const

Definition at line 255 of file ThreadPlanStack.cpp.

References GetCurrentPlanNoLock(), and m_stack_mutex.

Referenced by lldb_private::Thread::GetCurrentPlan().

◆ GetCurrentPlanNoLock()

lldb::ThreadPlanSP ThreadPlanStack::GetCurrentPlanNoLock ( ) const
private

Definition at line 260 of file ThreadPlanStack.cpp.

References m_plans.

Referenced by DiscardPlansUpToPlan(), GetCurrentPlan(), and GetPreviousPlan().

◆ GetExpressionVariable()

lldb::ExpressionVariableSP ThreadPlanStack::GetExpressionVariable ( ) const

Definition at line 311 of file ThreadPlanStack.cpp.

References m_completed_plans, and m_stack_mutex.

Referenced by lldb_private::Thread::GetExpressionVariable().

◆ GetInnermostExpression()

ThreadPlan * ThreadPlanStack::GetInnermostExpression ( ) const

◆ GetPlanByIndex()

lldb::ThreadPlanSP ThreadPlanStack::GetPlanByIndex ( uint32_t  plan_idx,
bool  skip_private = true 
) const

◆ GetPreviousPlan()

ThreadPlan * ThreadPlanStack::GetPreviousPlan ( ThreadPlan current_plan) const

◆ GetReturnValueObject()

lldb::ValueObjectSP ThreadPlanStack::GetReturnValueObject ( ) const

Definition at line 297 of file ThreadPlanStack.cpp.

References m_completed_plans, and m_stack_mutex.

Referenced by lldb_private::Thread::GetReturnValueObject().

◆ IsPlanDone()

bool ThreadPlanStack::IsPlanDone ( ThreadPlan plan) const

Definition at line 340 of file ThreadPlanStack.cpp.

References m_completed_plans, and m_stack_mutex.

Referenced by lldb_private::Thread::IsThreadPlanDone().

◆ PopPlan()

lldb::ThreadPlanSP ThreadPlanStack::PopPlan ( )

Definition at line 151 of file ThreadPlanStack.cpp.

References m_completed_plans, m_plans, and m_stack_mutex.

Referenced by lldb_private::Thread::PopPlan().

◆ PrintOneStackNoLock()

void ThreadPlanStack::PrintOneStackNoLock ( Stream s,
llvm::StringRef  stack_name,
const PlanStack stack,
lldb::DescriptionLevel  desc_level,
bool  include_internal 
) const
private

Definition at line 53 of file ThreadPlanStack.cpp.

References lldb_private::Stream::Indent(), and PrintPlanElement().

Referenced by DumpThreadPlans().

◆ PushPlan()

void ThreadPlanStack::PushPlan ( lldb::ThreadPlanSP  new_plan_sp)

Definition at line 133 of file ThreadPlanStack.cpp.

References m_plans, and m_stack_mutex.

Referenced by lldb_private::Thread::PushPlan().

◆ RestoreCompletedPlanCheckpoint()

void ThreadPlanStack::RestoreCompletedPlanCheckpoint ( size_t  checkpoint)

◆ ThreadDestroyed()

void ThreadPlanStack::ThreadDestroyed ( Thread thread)

Definition at line 106 of file ThreadPlanStack.cpp.

References m_completed_plans, m_discarded_plans, m_plans, and m_stack_mutex.

◆ WasPlanDiscarded()

bool ThreadPlanStack::WasPlanDiscarded ( ThreadPlan plan) const

Definition at line 349 of file ThreadPlanStack.cpp.

References m_discarded_plans, and m_stack_mutex.

Referenced by lldb_private::Thread::WasThreadPlanDiscarded().

◆ WillResume()

void ThreadPlanStack::WillResume ( )

Friends And Related Function Documentation

◆ lldb_private::Thread

friend class lldb_private::Thread
friend

Definition at line 34 of file ThreadPlanStack.h.

Member Data Documentation

◆ m_completed_plan_checkpoint

size_t lldb_private::ThreadPlanStack::m_completed_plan_checkpoint = 0
private

Definition at line 115 of file ThreadPlanStack.h.

Referenced by CheckpointCompletedPlans().

◆ m_completed_plan_store

std::unordered_map<size_t, PlanStack> lldb_private::ThreadPlanStack::m_completed_plan_store
private

◆ m_completed_plans

PlanStack lldb_private::ThreadPlanStack::m_completed_plans
private

◆ m_discarded_plans

PlanStack lldb_private::ThreadPlanStack::m_discarded_plans
private

Plans that have been discarded by this stop.

They get deleted when the thread resumes.

Definition at line 112 of file ThreadPlanStack.h.

Referenced by AnyDiscardedPlans(), DiscardPlanNoLock(), DumpThreadPlans(), ThreadDestroyed(), WasPlanDiscarded(), and WillResume().

◆ m_plans

PlanStack lldb_private::ThreadPlanStack::m_plans
private

◆ m_stack_mutex

llvm::sys::RWMutex lldb_private::ThreadPlanStack::m_stack_mutex
mutableprivate

The documentation for this class was generated from the following files: