LLDB mainline
|
#include <ThreadPlanSingleThreadTimeout.h>
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. | |
Thread & | GetThread () |
Returns the Thread that is using this thread plan. | |
Target & | GetTarget () |
const Target & | GetTarget () 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 | 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::ThreadPlanTracerSP & | GetThreadPlanTracer () |
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 ThreadPlanSingleThreadTimeout & | operator= (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) |
ThreadPlan * | GetPreviousPlan () |
lldb::StopInfoSP | GetPrivateStopInfo () |
void | SetStopInfo (lldb::StopInfoSP stop_reason_sp) |
bool | IsUsuallyUnexplainedStopReason (lldb::StopReason) |
Protected Attributes inherited from lldb_private::ThreadPlan | |
Status | m_status |
Process & | m_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. | |
Definition at line 36 of file ThreadPlanSingleThreadTimeout.h.
using lldb_private::ThreadPlanSingleThreadTimeout::TimeoutInfoSP = std::shared_ptr<ThreadPlanSingleThreadTimeout::TimeoutInfo> |
Definition at line 50 of file ThreadPlanSingleThreadTimeout.h.
|
strongprivate |
Enumerator | |
---|---|
WaitTimeout | |
AsyncInterrupt | |
Done |
Definition at line 37 of file ThreadPlanSingleThreadTimeout.h.
|
override |
Definition at line 38 of file ThreadPlanSingleThreadTimeout.cpp.
References m_info.
|
private |
Definition at line 27 of file ThreadPlanSingleThreadTimeout.cpp.
References m_info, m_state, m_timer_thread, and TimeoutThreadFunc().
|
privatedelete |
|
overridevirtual |
Reimplemented from lldb_private::ThreadPlan.
Definition at line 126 of file ThreadPlanSingleThreadTimeout.cpp.
References lldb_private::GetLog(), LLDB_LOGF, m_info, m_mutex, m_timer_thread, m_wakeup_cv, and lldb_private::Step.
|
overridevirtual |
Implements lldb_private::ThreadPlan.
Definition at line 139 of file ThreadPlanSingleThreadTimeout.cpp.
References lldb_private::GetLog(), GetRemainingTimeoutMilliSeconds(), IsTimeoutAsyncInterrupt(), LLDB_LOGF, and lldb_private::Step.
|
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.
[in] | s | The stream to which to print the description. |
[in] | level | The 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().
|
overridevirtual |
Implements lldb_private::ThreadPlan.
Definition at line 149 of file ThreadPlanSingleThreadTimeout.cpp.
References lldb_private::ThreadPlan::GetPlanRunState(), and lldb_private::ThreadPlan::GetPreviousPlan().
|
private |
Definition at line 42 of file ThreadPlanSingleThreadTimeout.cpp.
References lldb_private::ThreadProperties::GetSingleThreadPlanTimeout(), lldb_private::ThreadPlan::GetThread(), and m_timeout_start.
Referenced by DoPlanExplainsStop(), and GetDescription().
|
private |
Definition at line 217 of file ThreadPlanSingleThreadTimeout.cpp.
References Done, lldb_private::Thread::GetCurrentPlan(), lldb_private::GetLog(), lldb_private::ThreadPlan::GetPreviousPlan(), lldb_private::Process::ProcessEventData::GetRestartedFromEvent(), lldb_private::ThreadPlan::GetThread(), IsTimeoutAsyncInterrupt(), LLDB_LOGF, m_state, lldb_private::ThreadPlan::SetStopOthers(), and lldb_private::Step.
Referenced by ShouldStop().
|
private |
Definition at line 241 of file ThreadPlanSingleThreadTimeout.cpp.
References AsyncInterrupt, lldb_private::GetLog(), lldb_private::ThreadPlan::GetThread(), LLDB_LOGF, lldb_private::ThreadPlan::m_process, m_state, lldb_private::Process::SendAsyncInterrupt(), and lldb_private::Step.
Referenced by TimeoutThreadFunc().
|
inlineoverridevirtual |
Reimplemented from lldb_private::ThreadPlan.
Definition at line 71 of file ThreadPlanSingleThreadTimeout.h.
|
private |
Definition at line 202 of file ThreadPlanSingleThreadTimeout.cpp.
References AsyncInterrupt, lldb::eStateStopped, lldb::eStopReasonInterrupt, lldb_private::GetLog(), lldb_private::Process::ProcessEventData::GetStateFromEvent(), lldb_private::Thread::GetStopInfo(), lldb_private::ThreadPlan::GetThread(), LLDB_LOGF, m_state, lldb_private::StateAsCString(), and lldb_private::Step.
Referenced by DoPlanExplainsStop(), and HandleEvent().
|
overridevirtual |
Reimplemented from lldb_private::ThreadPlan.
Definition at line 178 of file ThreadPlanSingleThreadTimeout.cpp.
References lldb_private::GetLog(), LLDB_LOGF, and lldb_private::Step.
|
privatedelete |
|
static |
Definition at line 69 of file ThreadPlanSingleThreadTimeout.cpp.
References lldb_private::Thread::GetCurrentPlan(), lldb_private::GetLog(), lldb_private::ThreadProperties::GetSingleThreadPlanTimeout(), LLDB_LOGF, lldb_private::Thread::QueueThreadPlan(), lldb_private::Step, and lldb_private::ThreadPlan::StopOthers().
Referenced by lldb_private::TimeoutResumeAll::PushNewTimeout().
|
static |
Definition at line 91 of file ThreadPlanSingleThreadTimeout.cpp.
References lldb_private::Thread::GetCurrentPlan(), lldb_private::GetLog(), lldb_private::ThreadProperties::GetSingleThreadPlanTimeout(), LLDB_LOGF, lldb_private::Thread::QueueThreadPlan(), lldb_private::Step, and lldb_private::ThreadPlan::StopOthers().
Referenced by lldb_private::TimeoutResumeAll::ResumeWithTimeout().
|
overridevirtual |
Reimplemented from lldb_private::ThreadPlan.
Definition at line 189 of file ThreadPlanSingleThreadTimeout.cpp.
References lldb_private::ThreadPlan::GetPreviousPlan(), and lldb_private::ThreadPlan::SetStopOthers().
|
overridevirtual |
Implements lldb_private::ThreadPlan.
Definition at line 185 of file ThreadPlanSingleThreadTimeout.cpp.
References HandleEvent().
|
staticprivate |
Definition at line 57 of file ThreadPlanSingleThreadTimeout.cpp.
References AsyncInterrupt, Done, and WaitTimeout.
Referenced by GetDescription().
|
overridevirtual |
Reimplemented from lldb_private::ThreadPlan.
Definition at line 195 of file ThreadPlanSingleThreadTimeout.cpp.
References Done, lldb_private::ThreadPlan::GetPreviousPlan(), m_state, and lldb_private::ThreadPlan::StopOthers().
|
static |
Definition at line 153 of file ThreadPlanSingleThreadTimeout.cpp.
References lldb_private::GetLog(), lldb_private::ThreadProperties::GetSingleThreadPlanTimeout(), lldb_private::ThreadPlan::GetThread(), HandleTimeout(), LLDB_LOGF, m_info, m_mutex, m_timeout_start, m_wakeup_cv, and lldb_private::Step.
Referenced by ThreadPlanSingleThreadTimeout().
|
inlineoverridevirtual |
Returns whether this plan could be successfully created.
[in] | error | A stream to which to print some reason why the plan could not be created. Can be NULL. |
Implements lldb_private::ThreadPlan.
Definition at line 67 of file ThreadPlanSingleThreadTimeout.h.
|
overridevirtual |
Implements lldb_private::ThreadPlan.
Definition at line 117 of file ThreadPlanSingleThreadTimeout.cpp.
References lldb_private::GetLog(), LLDB_LOGF, m_info, lldb_private::Step, and WaitTimeout.
|
private |
Definition at line 97 of file ThreadPlanSingleThreadTimeout.h.
Referenced by DidPop(), ThreadPlanSingleThreadTimeout(), TimeoutThreadFunc(), WillStop(), and ~ThreadPlanSingleThreadTimeout().
|
private |
Definition at line 102 of file ThreadPlanSingleThreadTimeout.h.
Referenced by DidPop(), and TimeoutThreadFunc().
|
private |
Definition at line 98 of file ThreadPlanSingleThreadTimeout.h.
Referenced by GetDescription(), HandleEvent(), HandleTimeout(), IsTimeoutAsyncInterrupt(), StopOthers(), and ThreadPlanSingleThreadTimeout().
|
private |
Definition at line 105 of file ThreadPlanSingleThreadTimeout.h.
Referenced by GetRemainingTimeoutMilliSeconds(), and TimeoutThreadFunc().
|
private |
Definition at line 104 of file ThreadPlanSingleThreadTimeout.h.
Referenced by DidPop(), and ThreadPlanSingleThreadTimeout().
|
private |
Definition at line 103 of file ThreadPlanSingleThreadTimeout.h.
Referenced by DidPop(), and TimeoutThreadFunc().