24 Vote report_stop_vote,
Vote report_run_vote)
25 : m_process(*thread.GetProcess().get()), m_tid(thread.GetID()),
26 m_report_stop_vote(report_stop_vote), m_report_run_vote(report_run_vote),
27 m_takes_iteration_count(false), m_could_not_resolve_hw_bp(false),
28 m_thread(&thread), m_kind(kind), m_name(name), m_plan_complete_mutex(),
30 m_plan_private(false), m_okay_to_discard(true),
31 m_is_controlling_plan(false), m_plan_succeeded(true) {
86 LLDB_LOG(log,
"returning previous thread plan vote: {0}", prev_vote);
108 return (prev_plan ==
nullptr) ? false : prev_plan->
StopOthers();
130 "%s Thread #%u (0x%p): tid = 0x%4.4" PRIx64
", pc = 0x%8.8" PRIx64
131 ", sp = 0x%8.8" PRIx64
", fp = 0x%8.8" PRIx64
", "
132 "plan = '%s', state = %s, stop others = %d",
135 static_cast<uint64_t
>(
sp),
static_cast<uint64_t
>(
fp),
m_name.c_str(),
139 bool success =
DoWillResume(resume_state, current_plan);
147 static uint32_t g_nextPlanID = 0;
148 return ++g_nextPlanID;
193 s->
PutCString(
"Null thread plan - thread has been destroyed.");
197#ifdef LLDB_CONFIGURATION_DEBUG
199 "error: %s called on thread that has been destroyed (tid = 0x%" PRIx64
200 ", ptid = 0x%" PRIx64
")",
205 log->
Error(
"%s called on thread that has been destroyed (tid = 0x%" PRIx64
206 ", ptid = 0x%" PRIx64
")",
213#ifdef LLDB_CONFIGURATION_DEBUG
215 "error: %s called on thread that has been destroyed (tid = 0x%" PRIx64
216 ", ptid = 0x%" PRIx64
")",
221 log->
Error(
"%s called on thread that has been destroyed (tid = 0x%" PRIx64
222 ", ptid = 0x%" PRIx64
")",
229#ifdef LLDB_CONFIGURATION_DEBUG
231 "error: %s called on thread that has been destroyed (tid = 0x%" PRIx64
232 ", ptid = 0x%" PRIx64
")",
237 log->
Error(
"%s called on thread that has been destroyed (tid = 0x%" PRIx64
238 ", ptid = 0x%" PRIx64
")",
245#ifdef LLDB_CONFIGURATION_DEBUG
247 "error: %s called on thread that has been destroyed (tid = 0x%" PRIx64
248 ", ptid = 0x%" PRIx64
")",
253 log->
Error(
"%s called on thread that has been destroyed (tid = 0x%" PRIx64
254 ", ptid = 0x%" PRIx64
")",
263#ifdef LLDB_CONFIGURATION_DEBUG
265 "error: %s called on thread that has been destroyed (tid = 0x%" PRIx64
266 ", ptid = 0x%" PRIx64
")",
271 log->
Error(
"%s called on thread that has been destroyed (tid = 0x%" PRIx64
272 ", ptid = 0x%" PRIx64
")",
280#ifdef LLDB_CONFIGURATION_DEBUG
282 "error: %s called on thread that has been destroyed (tid = 0x%" PRIx64
283 ", ptid = 0x%" PRIx64
")",
288 log->
Error(
"%s called on thread that has been destroyed (tid = 0x%" PRIx64
289 ", ptid = 0x%" PRIx64
")",
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_LOG(log,...)
The LLDB_LOG* macros defined below are the way to emit log messages.
#define LLDB_LOGF(log,...)
void void void Error(const char *fmt,...) __attribute__((format(printf
ThreadList & GetThreadList()
Target & GetTarget()
Get the target object pointer for this module.
uint64_t GetPC(uint64_t fail_value=LLDB_INVALID_ADDRESS)
uint64_t GetSP(uint64_t fail_value=LLDB_INVALID_ADDRESS)
uint64_t GetFP(uint64_t fail_value=LLDB_INVALID_ADDRESS)
A stream class that can stream formatted output to a file.
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
lldb::ThreadSP FindThreadByID(lldb::tid_t tid, bool can_update=true)
bool MischiefManaged() override
lldb::StateType GetPlanRunState() override
ThreadPlanNull(Thread &thread)
~ThreadPlanNull() override
bool DoPlanExplainsStop(Event *event_ptr) 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 ShouldStop(Event *event_ptr) override
virtual Vote ShouldReportStop(Event *event_ptr)
virtual bool DoPlanExplainsStop(Event *event_ptr)=0
virtual bool OkayToDiscard()
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 lldb::StateType GetPlanRunState()=0
Vote ShouldReportRun(Event *event_ptr)
bool IsUsuallyUnexplainedStopReason(lldb::StopReason)
LazyBool m_cached_plan_explains_stop
void SetPlanComplete(bool success=true)
Thread & GetThread()
Returns the Thread that is using this thread plan.
bool PlanExplainsStop(Event *event_ptr)
virtual bool StopOthers()
static lldb::user_id_t GetNextID()
ThreadPlan * GetPreviousPlan()
void ClearThreadCache()
Clear the Thread* cache.
bool WillResume(lldb::StateType resume_state, bool current_plan)
virtual bool MischiefManaged()
lldb::ThreadPlanTracerSP m_tracer_sp
lldb::StateType RunState()
virtual void SetStopOthers(bool new_value)
void CachePlanExplainsStop(bool does_explain)
std::recursive_mutex m_plan_complete_mutex
virtual lldb::RegisterContextSP GetRegisterContext()=0
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
const char * StateAsCString(lldb::StateType state)
Converts a StateType to a C string.
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
std::shared_ptr< lldb_private::Thread > ThreadSP
StateType
Process and Thread States.
@ eStateRunning
Process or thread is running and can't be examined.
@ eStateStepping
Process or thread is in the process of stepping and can not be examined.
StopReason
Thread stop reasons.
@ eStopReasonInstrumentation
@ eStopReasonExec
Program was re-exec'ed.
@ eStopReasonInterrupt
Thread requested interrupt.
@ eStopReasonThreadExiting
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.