LLDB mainline
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
lldb_private::ThreadPlanSingleThreadTimeout Class Reference

#include <ThreadPlanSingleThreadTimeout.h>

Inheritance diagram for lldb_private::ThreadPlanSingleThreadTimeout:
Inheritance graph
[legend]

Classes

struct  TimeoutInfo
 

Public Types

using TimeoutInfoSP = std::shared_ptr< ThreadPlanSingleThreadTimeout::TimeoutInfo >
 
- Public Types inherited from lldb_private::ThreadPlan
enum  ThreadPlanKind {
  eKindGeneric , eKindNull , eKindBase , eKindCallFunction ,
  eKindPython , eKindStepInstruction , eKindStepOut , eKindStepOverBreakpoint ,
  eKindStepOverRange , eKindStepInRange , eKindRunToAddress , eKindStepThrough ,
  eKindStepUntil , eKindSingleThreadTimeout
}
 

Public Member Functions

 ~ThreadPlanSingleThreadTimeout () override
 
void GetDescription (Stream *s, lldb::DescriptionLevel level) override
 Print a description of this thread to the stream s.
 
bool ValidatePlan (Stream *error) override
 Returns whether this plan could be successfully created.
 
bool WillStop () override
 
void DidPop () override
 
bool IsLeafPlan () override
 
bool DoPlanExplainsStop (Event *event_ptr) override
 
lldb::StateType GetPlanRunState () override
 
bool MischiefManaged () override
 
bool ShouldStop (Event *event_ptr) override
 
void SetStopOthers (bool new_value) override
 
bool StopOthers () override
 
- Public Member Functions inherited from lldb_private::ThreadPlan
virtual ~ThreadPlan ()
 
const char * GetName () const
 Returns the name of this thread plan.
 
ThreadGetThread ()
 Returns the Thread that is using this thread plan.
 
TargetGetTarget ()
 
const TargetGetTarget () const
 
void ClearThreadCache ()
 Clear the Thread* cache.
 
virtual void GetDescription (Stream *s, lldb::DescriptionLevel level)=0
 Print a description of this thread to the stream s.
 
virtual bool ValidatePlan (Stream *error)=0
 Returns whether this plan could be successfully created.
 
bool TracerExplainsStop ()
 
lldb::StateType RunState ()
 
bool PlanExplainsStop (Event *event_ptr)
 
virtual bool ShouldStop (Event *event_ptr)=0
 
virtual bool ShouldAutoContinue (Event *event_ptr)
 Returns whether this thread plan overrides the ShouldStop of subsequently processed plans.
 
virtual Vote ShouldReportStop (Event *event_ptr)
 
Vote ShouldReportRun (Event *event_ptr)
 
virtual void SetStopOthers (bool new_value)
 
virtual bool StopOthers ()
 
virtual bool SupportsResumeOthers ()
 
virtual bool ShouldRunBeforePublicStop ()
 
bool WillResume (lldb::StateType resume_state, bool current_plan)
 
virtual bool WillStop ()=0
 
bool IsControllingPlan ()
 
virtual bool IsLeafPlan ()
 
bool SetIsControllingPlan (bool value)
 
virtual bool OkayToDiscard ()
 
void SetOkayToDiscard (bool value)
 
virtual bool MischiefManaged ()
 
virtual void ThreadDestroyed ()
 
bool GetPrivate ()
 
void SetPrivate (bool input)
 
virtual void DidPush ()
 
virtual void DidPop ()
 
ThreadPlanKind GetKind () const
 
bool IsPlanComplete ()
 
void SetPlanComplete (bool success=true)
 
virtual bool IsPlanStale ()
 
bool PlanSucceeded ()
 
virtual bool IsBasePlan ()
 
lldb::ThreadPlanTracerSPGetThreadPlanTracer ()
 
void SetThreadPlanTracer (lldb::ThreadPlanTracerSP new_tracer_sp)
 
void DoTraceLog ()
 
virtual lldb::ValueObjectSP GetReturnValueObject ()
 
virtual lldb::ExpressionVariableSP GetExpressionVariable ()
 
virtual void RestoreThreadState ()
 
virtual bool IsVirtualStep ()
 
bool SetIterationCount (size_t count)
 
virtual lldb::StateType GetPlanRunState ()=0
 
- Public Member Functions inherited from lldb_private::UserID
 UserID (lldb::user_id_t uid=LLDB_INVALID_UID)
 Construct with optional user ID.
 
 ~UserID ()=default
 Destructor.
 
void Clear ()
 Clears the object state.
 
lldb::user_id_t GetID () const
 Get accessor for the user ID.
 
void SetID (lldb::user_id_t uid)
 Set accessor for the user ID.
 

Static Public Member Functions

static void PushNewWithTimeout (Thread &thread, TimeoutInfoSP &info)
 
static void ResumeFromPrevState (Thread &thread, TimeoutInfoSP &info)
 
static void TimeoutThreadFunc (ThreadPlanSingleThreadTimeout *self)
 

Private Types

enum class  State { WaitTimeout , AsyncInterrupt , Done }
 

Private Member Functions

 ThreadPlanSingleThreadTimeout (Thread &thread, TimeoutInfoSP &info)
 
bool IsTimeoutAsyncInterrupt (Event *event_ptr)
 
bool HandleEvent (Event *event_ptr)
 
void HandleTimeout ()
 
uint64_t GetRemainingTimeoutMilliSeconds ()
 
 ThreadPlanSingleThreadTimeout (const ThreadPlanSingleThreadTimeout &)=delete
 
const ThreadPlanSingleThreadTimeoutoperator= (const ThreadPlanSingleThreadTimeout &)=delete
 

Static Private Member Functions

static std::string StateToString (State state)
 

Private Attributes

TimeoutInfoSP m_info
 
State m_state
 
std::mutex m_mutex
 
std::condition_variable m_wakeup_cv
 
std::thread m_timer_thread
 
std::chrono::steady_clock::time_point m_timeout_start
 

Additional Inherited Members

- Protected Member Functions inherited from lldb_private::ThreadPlan
 ThreadPlan (ThreadPlanKind kind, const char *name, Thread &thread, Vote report_stop_vote, Vote report_run_vote)
 
virtual bool DoWillResume (lldb::StateType resume_state, bool current_plan)
 
virtual bool DoPlanExplainsStop (Event *event_ptr)=0
 
void PushPlan (lldb::ThreadPlanSP &thread_plan_sp)
 
ThreadPlanGetPreviousPlan ()
 
lldb::StopInfoSP GetPrivateStopInfo ()
 
void SetStopInfo (lldb::StopInfoSP stop_reason_sp)
 
bool IsUsuallyUnexplainedStopReason (lldb::StopReason)
 
- Protected Attributes inherited from lldb_private::ThreadPlan
Status m_status
 
Processm_process
 
lldb::tid_t m_tid
 
Vote m_report_stop_vote
 
Vote m_report_run_vote
 
bool m_takes_iteration_count
 
bool m_could_not_resolve_hw_bp
 
int32_t m_iteration_count = 1
 
- Protected Attributes inherited from lldb_private::UserID
lldb::user_id_t m_uid
 The user ID that uniquely identifies an object.
 

Detailed Description

Definition at line 36 of file ThreadPlanSingleThreadTimeout.h.

Member Typedef Documentation

◆ TimeoutInfoSP

Definition at line 50 of file ThreadPlanSingleThreadTimeout.h.

Member Enumeration Documentation

◆ State

Enumerator
WaitTimeout 
AsyncInterrupt 
Done 

Definition at line 37 of file ThreadPlanSingleThreadTimeout.h.

Constructor & Destructor Documentation

◆ ~ThreadPlanSingleThreadTimeout()

ThreadPlanSingleThreadTimeout::~ThreadPlanSingleThreadTimeout ( )
override

Definition at line 38 of file ThreadPlanSingleThreadTimeout.cpp.

References m_info.

◆ ThreadPlanSingleThreadTimeout() [1/2]

ThreadPlanSingleThreadTimeout::ThreadPlanSingleThreadTimeout ( Thread thread,
TimeoutInfoSP info 
)
private

Definition at line 27 of file ThreadPlanSingleThreadTimeout.cpp.

References m_info, m_state, m_timer_thread, and TimeoutThreadFunc().

◆ ThreadPlanSingleThreadTimeout() [2/2]

lldb_private::ThreadPlanSingleThreadTimeout::ThreadPlanSingleThreadTimeout ( const ThreadPlanSingleThreadTimeout )
privatedelete

Member Function Documentation

◆ DidPop()

void ThreadPlanSingleThreadTimeout::DidPop ( )
overridevirtual

◆ DoPlanExplainsStop()

bool ThreadPlanSingleThreadTimeout::DoPlanExplainsStop ( Event event_ptr)
overridevirtual

◆ GetDescription()

void ThreadPlanSingleThreadTimeout::GetDescription ( Stream s,
lldb::DescriptionLevel  level 
)
overridevirtual

Print a description of this thread to the stream s.

thread. Don't expect that the result of GetThread is valid in the description method. This might get called when the underlying Thread has not been reported, so we only know the TID and not the thread.

Parameters
[in]sThe stream to which to print the description.
[in]levelThe level of description desired. Note that eDescriptionLevelBrief will be used in the stop message printed when the plan is complete.

Implements lldb_private::ThreadPlan.

Definition at line 51 of file ThreadPlanSingleThreadTimeout.cpp.

References GetRemainingTimeoutMilliSeconds(), m_state, lldb_private::Stream::Printf(), and StateToString().

◆ GetPlanRunState()

lldb::StateType ThreadPlanSingleThreadTimeout::GetPlanRunState ( )
overridevirtual

◆ GetRemainingTimeoutMilliSeconds()

uint64_t ThreadPlanSingleThreadTimeout::GetRemainingTimeoutMilliSeconds ( )
private

◆ HandleEvent()

bool ThreadPlanSingleThreadTimeout::HandleEvent ( Event event_ptr)
private

◆ HandleTimeout()

void ThreadPlanSingleThreadTimeout::HandleTimeout ( )
private

◆ IsLeafPlan()

bool lldb_private::ThreadPlanSingleThreadTimeout::IsLeafPlan ( )
inlineoverridevirtual

Reimplemented from lldb_private::ThreadPlan.

Definition at line 71 of file ThreadPlanSingleThreadTimeout.h.

◆ IsTimeoutAsyncInterrupt()

bool ThreadPlanSingleThreadTimeout::IsTimeoutAsyncInterrupt ( Event event_ptr)
private

◆ MischiefManaged()

bool ThreadPlanSingleThreadTimeout::MischiefManaged ( )
overridevirtual

Reimplemented from lldb_private::ThreadPlan.

Definition at line 184 of file ThreadPlanSingleThreadTimeout.cpp.

References lldb_private::GetLog(), LLDB_LOGF, and lldb_private::Step.

◆ operator=()

const ThreadPlanSingleThreadTimeout & lldb_private::ThreadPlanSingleThreadTimeout::operator= ( const ThreadPlanSingleThreadTimeout )
privatedelete

◆ PushNewWithTimeout()

void ThreadPlanSingleThreadTimeout::PushNewWithTimeout ( Thread thread,
TimeoutInfoSP info 
)
static

◆ ResumeFromPrevState()

void ThreadPlanSingleThreadTimeout::ResumeFromPrevState ( Thread thread,
TimeoutInfoSP info 
)
static

◆ SetStopOthers()

void ThreadPlanSingleThreadTimeout::SetStopOthers ( bool  new_value)
overridevirtual

◆ ShouldStop()

bool ThreadPlanSingleThreadTimeout::ShouldStop ( Event event_ptr)
overridevirtual

Implements lldb_private::ThreadPlan.

Definition at line 191 of file ThreadPlanSingleThreadTimeout.cpp.

References HandleEvent().

◆ StateToString()

std::string ThreadPlanSingleThreadTimeout::StateToString ( State  state)
staticprivate

Definition at line 57 of file ThreadPlanSingleThreadTimeout.cpp.

References AsyncInterrupt, Done, and WaitTimeout.

Referenced by GetDescription().

◆ StopOthers()

bool ThreadPlanSingleThreadTimeout::StopOthers ( )
overridevirtual

◆ TimeoutThreadFunc()

void ThreadPlanSingleThreadTimeout::TimeoutThreadFunc ( ThreadPlanSingleThreadTimeout self)
static

◆ ValidatePlan()

bool lldb_private::ThreadPlanSingleThreadTimeout::ValidatePlan ( Stream error)
inlineoverridevirtual

Returns whether this plan could be successfully created.

Parameters
[in]errorA stream to which to print some reason why the plan could not be created. Can be NULL.
Returns
true if the plan should be queued, false otherwise.

Implements lldb_private::ThreadPlan.

Definition at line 67 of file ThreadPlanSingleThreadTimeout.h.

◆ WillStop()

bool ThreadPlanSingleThreadTimeout::WillStop ( )
overridevirtual

Member Data Documentation

◆ m_info

TimeoutInfoSP lldb_private::ThreadPlanSingleThreadTimeout::m_info
private

◆ m_mutex

std::mutex lldb_private::ThreadPlanSingleThreadTimeout::m_mutex
private

Definition at line 102 of file ThreadPlanSingleThreadTimeout.h.

Referenced by DidPop(), and TimeoutThreadFunc().

◆ m_state

State lldb_private::ThreadPlanSingleThreadTimeout::m_state
private

◆ m_timeout_start

std::chrono::steady_clock::time_point lldb_private::ThreadPlanSingleThreadTimeout::m_timeout_start
private

◆ m_timer_thread

std::thread lldb_private::ThreadPlanSingleThreadTimeout::m_timer_thread
private

Definition at line 104 of file ThreadPlanSingleThreadTimeout.h.

Referenced by DidPop(), and ThreadPlanSingleThreadTimeout().

◆ m_wakeup_cv

std::condition_variable lldb_private::ThreadPlanSingleThreadTimeout::m_wakeup_cv
private

Definition at line 103 of file ThreadPlanSingleThreadTimeout.h.

Referenced by DidPop(), and TimeoutThreadFunc().


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