LLDB mainline
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
lldb_private::Thread Class Referenceabstract

#include <Thread.h>

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

Classes

class  ThreadEventData
 
struct  ThreadStateCheckpoint
 

Public Types

enum  {
  eBroadcastBitStackChanged = (1 << 0) , eBroadcastBitThreadSuspended = (1 << 1) , eBroadcastBitThreadResumed = (1 << 2) , eBroadcastBitSelectedFrameChanged = (1 << 3) ,
  eBroadcastBitThreadSelected = (1 << 4)
}
 Broadcaster event bits definitions. More...
 

Public Member Functions

llvm::StringRef GetBroadcasterClass () const override
 This needs to be filled in if you are going to register the broadcaster with the broadcaster manager and do broadcaster class matching.
 
 Thread (Process &process, lldb::tid_t tid, bool use_invalid_index_id=false)
 Constructor.
 
 ~Thread () override
 
lldb::ProcessSP GetProcess () const
 
int GetResumeSignal () const
 
void SetResumeSignal (int signal)
 
lldb::StateType GetState () const
 
void SetState (lldb::StateType state)
 
void SetResumeState (lldb::StateType state, bool override_suspend=false)
 Sets the USER resume state for this thread.
 
lldb::StateType GetResumeState () const
 Gets the USER resume state for this thread.
 
void SetupForResume ()
 
bool ShouldResume (lldb::StateType resume_state)
 
virtual void WillResume (lldb::StateType resume_state)
 
virtual void DidResume ()
 
virtual void DidStop ()
 
virtual void RefreshStateAfterStop ()=0
 
std::string GetStopDescription ()
 
std::string GetStopDescriptionRaw ()
 
void WillStop ()
 
bool ShouldStop (Event *event_ptr)
 
Vote ShouldReportStop (Event *event_ptr)
 
Vote ShouldReportRun (Event *event_ptr)
 
void Flush ()
 
virtual bool MatchesSpec (const ThreadSpec *spec)
 
lldb::StopInfoSP GetStopInfo ()
 
lldb::StopReason GetStopReason ()
 
bool StopInfoIsUpToDate () const
 
void SetStopInfoToNothing ()
 
bool ThreadStoppedForAReason ()
 
virtual const char * GetInfo ()
 
StructuredData::ObjectSP GetExtendedInfo ()
 Retrieve a dictionary of information about this thread.
 
virtual const char * GetName ()
 
virtual void SetName (const char *name)
 
virtual lldb_private::LazyBool GetAssociatedWithLibdispatchQueue ()
 Whether this thread can be associated with a libdispatch queue.
 
virtual void SetAssociatedWithLibdispatchQueue (lldb_private::LazyBool associated_with_libdispatch_queue)
 
virtual lldb::queue_id_t GetQueueID ()
 Retrieve the Queue ID for the queue currently using this Thread.
 
virtual void SetQueueID (lldb::queue_id_t new_val)
 
virtual const char * GetQueueName ()
 Retrieve the Queue name for the queue currently using this Thread.
 
virtual void SetQueueName (const char *name)
 
virtual lldb::QueueKind GetQueueKind ()
 Retrieve the Queue kind for the queue currently using this Thread.
 
virtual void SetQueueKind (lldb::QueueKind kind)
 
virtual lldb::QueueSP GetQueue ()
 Retrieve the Queue for this thread, if any.
 
virtual lldb::addr_t GetQueueLibdispatchQueueAddress ()
 Retrieve the address of the libdispatch_queue_t struct for queue currently using this Thread.
 
virtual void SetQueueLibdispatchQueueAddress (lldb::addr_t dispatch_queue_t)
 
virtual bool ThreadHasQueueInformation () const
 Whether this Thread already has all the Queue information cached or not.
 
virtual uint32_t GetStackFrameCount ()
 GetStackFrameCount can be expensive.
 
virtual lldb::StackFrameSP GetStackFrameAtIndex (uint32_t idx)
 
virtual lldb::StackFrameSP GetFrameWithConcreteFrameIndex (uint32_t unwind_idx)
 
bool DecrementCurrentInlinedDepth ()
 
uint32_t GetCurrentInlinedDepth ()
 
Status ReturnFromFrameWithIndex (uint32_t frame_idx, lldb::ValueObjectSP return_value_sp, bool broadcast=false)
 
Status ReturnFromFrame (lldb::StackFrameSP frame_sp, lldb::ValueObjectSP return_value_sp, bool broadcast=false)
 
Status JumpToLine (const FileSpec &file, uint32_t line, bool can_leave_function, std::string *warnings=nullptr)
 
virtual lldb::StackFrameSP GetFrameWithStackID (const StackID &stack_id)
 
uint32_t GetSelectedFrameIndex (SelectMostRelevant select_most_relevant)
 
lldb::StackFrameSP GetSelectedFrame (SelectMostRelevant select_most_relevant)
 
uint32_t SetSelectedFrame (lldb_private::StackFrame *frame, bool broadcast=false)
 
bool SetSelectedFrameByIndex (uint32_t frame_idx, bool broadcast=false)
 
bool SetSelectedFrameByIndexNoisily (uint32_t frame_idx, Stream &output_stream)
 
void SetDefaultFileAndLineToSelectedFrame ()
 
virtual lldb::RegisterContextSP GetRegisterContext ()=0
 
virtual lldb::RegisterContextSP CreateRegisterContextForFrame (StackFrame *frame)=0
 
virtual void ClearStackFrames ()
 
virtual bool SetBackingThread (const lldb::ThreadSP &thread_sp)
 
virtual lldb::ThreadSP GetBackingThread () const
 
virtual void ClearBackingThread ()
 
void DumpTraceInstructions (Stream &s, size_t count, size_t start_position=0) const
 Dump count instructions of the thread's Trace starting at the start_position position in reverse order.
 
bool DumpUsingFormat (Stream &strm, uint32_t frame_idx, const FormatEntity::Entry *format)
 Print a description of this thread using the provided thread format.
 
void DumpUsingSettingsFormat (Stream &strm, uint32_t frame_idx, bool stop_format)
 
bool GetDescription (Stream &s, lldb::DescriptionLevel level, bool print_json_thread, bool print_json_stopinfo)
 
virtual Status StepIn (bool source_step, LazyBool step_in_avoids_code_without_debug_info=eLazyBoolCalculate, LazyBool step_out_avoids_code_without_debug_info=eLazyBoolCalculate)
 Default implementation for stepping into.
 
virtual Status StepOver (bool source_step, LazyBool step_out_avoids_code_without_debug_info=eLazyBoolCalculate)
 Default implementation for stepping over.
 
virtual Status StepOut (uint32_t frame_idx=0)
 Default implementation for stepping out.
 
virtual lldb::addr_t GetThreadPointer ()
 Retrieves the per-thread data area.
 
virtual lldb::addr_t GetThreadLocalData (const lldb::ModuleSP module, lldb::addr_t tls_file_addr)
 Retrieves the per-module TLS block for a thread.
 
virtual bool SafeToCallFunctions ()
 Check whether this thread is safe to run functions.
 
lldb::ThreadPlanSP QueueBasePlan (bool abort_other_plans)
 Queues the base plan for a thread.
 
virtual lldb::ThreadPlanSP QueueThreadPlanForStepSingleInstruction (bool step_over, bool abort_other_plans, bool stop_other_threads, Status &status)
 Queues the plan used to step one instruction from the current PC of thread.
 
virtual lldb::ThreadPlanSP QueueThreadPlanForStepOverRange (bool abort_other_plans, const AddressRange &range, const SymbolContext &addr_context, lldb::RunMode stop_other_threads, Status &status, LazyBool step_out_avoids_code_without_debug_info=eLazyBoolCalculate)
 Queues the plan used to step through an address range, stepping over function calls.
 
virtual lldb::ThreadPlanSP QueueThreadPlanForStepOverRange (bool abort_other_plans, const LineEntry &line_entry, const SymbolContext &addr_context, lldb::RunMode stop_other_threads, Status &status, LazyBool step_out_avoids_code_without_debug_info=eLazyBoolCalculate)
 
virtual lldb::ThreadPlanSP QueueThreadPlanForStepInRange (bool abort_other_plans, const AddressRange &range, const SymbolContext &addr_context, const char *step_in_target, lldb::RunMode stop_other_threads, Status &status, LazyBool step_in_avoids_code_without_debug_info=eLazyBoolCalculate, LazyBool step_out_avoids_code_without_debug_info=eLazyBoolCalculate)
 Queues the plan used to step through an address range, stepping into functions.
 
virtual lldb::ThreadPlanSP QueueThreadPlanForStepInRange (bool abort_other_plans, const LineEntry &line_entry, const SymbolContext &addr_context, const char *step_in_target, lldb::RunMode stop_other_threads, Status &status, LazyBool step_in_avoids_code_without_debug_info=eLazyBoolCalculate, LazyBool step_out_avoids_code_without_debug_info=eLazyBoolCalculate)
 
virtual lldb::ThreadPlanSP QueueThreadPlanForStepOut (bool abort_other_plans, SymbolContext *addr_context, bool first_insn, bool stop_other_threads, Vote report_stop_vote, Vote report_run_vote, uint32_t frame_idx, Status &status, LazyBool step_out_avoids_code_without_debug_info=eLazyBoolCalculate)
 Queue the plan used to step out of the function at the current PC of thread.
 
virtual lldb::ThreadPlanSP QueueThreadPlanForStepOutNoShouldStop (bool abort_other_plans, SymbolContext *addr_context, bool first_insn, bool stop_other_threads, Vote report_stop_vote, Vote report_run_vote, uint32_t frame_idx, Status &status, bool continue_to_next_branch=false)
 Queue the plan used to step out of the function at the current PC of a thread.
 
virtual lldb::ThreadPlanSP QueueThreadPlanForStepThrough (StackID &return_stack_id, bool abort_other_plans, bool stop_other_threads, Status &status)
 Gets the plan used to step through the code that steps from a function call site at the current PC into the actual function call.
 
virtual lldb::ThreadPlanSP QueueThreadPlanForRunToAddress (bool abort_other_plans, Address &target_addr, bool stop_other_threads, Status &status)
 Gets the plan used to continue from the current PC.
 
virtual lldb::ThreadPlanSP QueueThreadPlanForStepUntil (bool abort_other_plans, lldb::addr_t *address_list, size_t num_addresses, bool stop_others, uint32_t frame_idx, Status &status)
 
virtual lldb::ThreadPlanSP QueueThreadPlanForStepScripted (bool abort_other_plans, const char *class_name, StructuredData::ObjectSP extra_args_sp, bool stop_other_threads, Status &status)
 
void AutoCompleteThreadPlans (CompletionRequest &request) const
 Format the thread plan information for auto completion.
 
ThreadPlanGetCurrentPlan () const
 Gets the plan which will execute next on the plan stack.
 
Status UnwindInnermostExpression ()
 Unwinds the thread stack for the innermost expression plan currently on the thread plan stack.
 
lldb::ThreadPlanSP GetCompletedPlan () const
 Gets the outer-most plan that was popped off the plan stack in the most recent stop.
 
lldb::ValueObjectSP GetReturnValueObject () const
 Gets the outer-most return value from the completed plans.
 
lldb::ExpressionVariableSP GetExpressionVariable () const
 Gets the outer-most expression variable from the completed plans.
 
bool IsThreadPlanDone (ThreadPlan *plan) const
 Checks whether the given plan is in the completed plans for this stop.
 
bool WasThreadPlanDiscarded (ThreadPlan *plan) const
 Checks whether the given plan is in the discarded plans for this stop.
 
bool CompletedPlanOverridesBreakpoint () const
 Check if we have completed plan to override breakpoint stop reason.
 
Status QueueThreadPlan (lldb::ThreadPlanSP &plan_sp, bool abort_other_plans)
 Queues a generic thread plan.
 
void DiscardThreadPlans (bool force)
 Discards the plans queued on the plan stack of the current thread.
 
void DiscardThreadPlansUpToPlan (lldb::ThreadPlanSP &up_to_plan_sp)
 Discards the plans queued on the plan stack of the current thread up to and including up_to_plan_sp.
 
void DiscardThreadPlansUpToPlan (ThreadPlan *up_to_plan_ptr)
 
bool DiscardUserThreadPlansUpToIndex (uint32_t thread_index)
 Discards the plans queued on the plan stack of the current thread up to and including the plan in that matches thread_index counting only the non-Private plans.
 
virtual bool CheckpointThreadState (ThreadStateCheckpoint &saved_state)
 
virtual bool RestoreRegisterStateFromCheckpoint (ThreadStateCheckpoint &saved_state)
 
void RestoreThreadStateFromCheckpoint (ThreadStateCheckpoint &saved_state)
 
uint32_t GetIndexID () const
 
virtual uint32_t GetExtendedBacktraceOriginatingIndexID ()
 
virtual lldb::user_id_t GetProtocolID () const
 
lldb::TargetSP CalculateTarget () override
 
lldb::ProcessSP CalculateProcess () override
 
lldb::ThreadSP CalculateThread () override
 
lldb::StackFrameSP CalculateStackFrame () override
 
void CalculateExecutionContext (ExecutionContext &exe_ctx) override
 Reconstruct the object's execution context into sc.
 
lldb::StackFrameSP GetStackFrameSPForStackFramePtr (StackFrame *stack_frame_ptr)
 
size_t GetStatus (Stream &strm, uint32_t start_frame, uint32_t num_frames, uint32_t num_frames_with_source, bool stop_format, bool show_hidden, bool only_stacks=false)
 
size_t GetStackFrameStatus (Stream &strm, uint32_t first_frame, uint32_t num_frames, bool show_frame_info, uint32_t num_frames_with_source, bool show_hidden)
 
bool IsValid () const
 
virtual lldb::StopInfoSP GetPrivateStopInfo (bool calculate=true)
 
void CalculatePublicStopInfo ()
 
virtual bool CalculateStopInfo ()=0
 Ask the thread subclass to set its stop info.
 
lldb::StateType GetTemporaryResumeState () const
 
void SetStopInfo (const lldb::StopInfoSP &stop_info_sp)
 
void ResetStopInfo ()
 
void SetShouldReportStop (Vote vote)
 
void SetShouldRunBeforePublicStop (bool newval)
 
bool ShouldRunBeforePublicStop ()
 
virtual void SetExtendedBacktraceToken (uint64_t token)
 Sets the extended backtrace token for this thread.
 
virtual uint64_t GetExtendedBacktraceToken ()
 Gets the extended backtrace token for this thread.
 
lldb::ValueObjectSP GetCurrentException ()
 
lldb::ThreadSP GetCurrentExceptionBacktrace ()
 
lldb::ValueObjectSP GetSiginfoValue ()
 
std::optional< lldb::addr_tGetPreviousFrameZeroPC ()
 Request the pc value the thread had when previously stopped.
 
- Public Member Functions inherited from lldb_private::ThreadProperties
 ThreadProperties (bool is_global)
 
 ~ThreadProperties () override
 
const RegularExpressionGetSymbolsToAvoidRegexp ()
 The regular expression returned determines symbols that this thread won't stop in during "step-in" operations.
 
FileSpecList GetLibrariesToAvoid () const
 
bool GetTraceEnabledState () const
 
bool GetStepInAvoidsNoDebug () const
 
bool GetStepOutAvoidsNoDebug () const
 
uint64_t GetMaxBacktraceDepth () const
 
uint64_t GetSingleThreadPlanTimeout () const
 
- Public Member Functions inherited from lldb_private::Properties
 Properties ()
 
 Properties (const lldb::OptionValuePropertiesSP &collection_sp)
 
virtual ~Properties ()
 
virtual lldb::OptionValuePropertiesSP GetValueProperties () const
 
virtual lldb::OptionValueSP GetPropertyValue (const ExecutionContext *exe_ctx, llvm::StringRef property_path, Status &error) const
 
virtual Status SetPropertyValue (const ExecutionContext *exe_ctx, VarSetOperationType op, llvm::StringRef property_path, llvm::StringRef value)
 
virtual Status DumpPropertyValue (const ExecutionContext *exe_ctx, Stream &strm, llvm::StringRef property_path, uint32_t dump_mask, bool is_json=false)
 
virtual void DumpAllPropertyValues (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask, bool is_json=false)
 
virtual void DumpAllDescriptions (CommandInterpreter &interpreter, Stream &strm) const
 
size_t Apropos (llvm::StringRef keyword, std::vector< const Property * > &matching_properties) const
 
template<typename T >
GetPropertyAtIndexAs (uint32_t idx, T default_value, const ExecutionContext *exe_ctx=nullptr) const
 
template<typename T , typename U = typename std::remove_pointer<T>::type, std::enable_if_t< std::is_pointer_v< T >, bool > = true>
const U * GetPropertyAtIndexAs (uint32_t idx, const ExecutionContext *exe_ctx=nullptr) const
 
template<typename T >
bool SetPropertyAtIndex (uint32_t idx, T t, const ExecutionContext *exe_ctx=nullptr) const
 
- 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.
 
- Public Member Functions inherited from lldb_private::ExecutionContextScope
virtual ~ExecutionContextScope ()=default
 
virtual lldb::TargetSP CalculateTarget ()=0
 
virtual lldb::ProcessSP CalculateProcess ()=0
 
virtual lldb::ThreadSP CalculateThread ()=0
 
virtual lldb::StackFrameSP CalculateStackFrame ()=0
 
virtual void CalculateExecutionContext (ExecutionContext &exe_ctx)=0
 Reconstruct the object's execution context into sc.
 
- Public Member Functions inherited from lldb_private::Broadcaster
 Broadcaster (lldb::BroadcasterManagerSP manager_sp, std::string name)
 Construct with a broadcaster with a name.
 
virtual ~Broadcaster ()
 Destructor.
 
void CheckInWithManager ()
 
void BroadcastEvent (lldb::EventSP &event_sp)
 Broadcast an event which has no associated data.
 
void BroadcastEventIfUnique (lldb::EventSP &event_sp)
 
void BroadcastEvent (uint32_t event_type, const lldb::EventDataSP &event_data_sp)
 
void BroadcastEvent (uint32_t event_type)
 
void BroadcastEventIfUnique (uint32_t event_type)
 
void Clear ()
 
virtual void AddInitialEventsToListener (const lldb::ListenerSP &listener_sp, uint32_t requested_events)
 
uint32_t AddListener (const lldb::ListenerSP &listener_sp, uint32_t event_mask)
 Listen for any events specified by event_mask.
 
const std::string & GetBroadcasterName ()
 Get this broadcaster's name.
 
bool GetEventNames (Stream &s, const uint32_t event_mask, bool prefix_with_broadcaster_name) const
 Get the event name(s) for one or more event bits.
 
void SetEventName (uint32_t event_mask, const char *name)
 Set the name for an event bit.
 
const char * GetEventName (uint32_t event_mask) const
 
bool EventTypeHasListeners (uint32_t event_type)
 
bool RemoveListener (const lldb::ListenerSP &listener_sp, uint32_t event_mask=UINT32_MAX)
 Removes a Listener from this broadcasters list and frees the event bits specified by event_mask that were previously acquired by listener (assuming listener was listening to this object) for other listener objects to use.
 
bool HijackBroadcaster (const lldb::ListenerSP &listener_sp, uint32_t event_mask=UINT32_MAX)
 Provides a simple mechanism to temporarily redirect events from broadcaster.
 
bool IsHijackedForEvent (uint32_t event_mask)
 
void RestoreBroadcaster ()
 Restore the state of the Broadcaster from a previous hijack attempt.
 
virtual llvm::StringRef GetBroadcasterClass () const
 This needs to be filled in if you are going to register the broadcaster with the broadcaster manager and do broadcaster class matching.
 
lldb::BroadcasterManagerSP GetManager ()
 
void SetPrimaryListener (lldb::ListenerSP listener_sp)
 
lldb::ListenerSP GetPrimaryListener ()
 

Static Public Member Functions

static llvm::StringRef GetStaticBroadcasterClass ()
 
static void SettingsInitialize ()
 
static void SettingsTerminate ()
 
static ThreadPropertiesGetGlobalProperties ()
 
static std::string RunModeAsString (lldb::RunMode mode)
 
static std::string StopReasonAsString (lldb::StopReason reason)
 
- Static Public Member Functions inherited from lldb_private::Properties
static llvm::StringRef GetExperimentalSettingsName ()
 
static bool IsSettingExperimental (llvm::StringRef setting)
 

Protected Member Functions

virtual void DestroyThread ()
 
ThreadPlanStackGetPlans () const
 
void PushPlan (lldb::ThreadPlanSP plan_sp)
 
void PopPlan ()
 
void DiscardPlan ()
 
ThreadPlanGetPreviousPlan (ThreadPlan *plan) const
 
virtual UnwindGetUnwinder ()
 
virtual bool IsStillAtLastBreakpointHit ()
 
virtual bool IsOperatingSystemPluginThread () const
 
virtual lldb_private::StructuredData::ObjectSP FetchThreadExtendedInfo ()
 
lldb::StackFrameListSP GetStackFrameList ()
 
void SetTemporaryResumeState (lldb::StateType new_state)
 
void FrameSelectedCallback (lldb_private::StackFrame *frame)
 
virtual llvm::Expected< std::unique_ptr< llvm::MemoryBuffer > > GetSiginfo (size_t max_size) const
 
- Protected Member Functions inherited from lldb_private::Broadcaster
BroadcasterImplSP GetBroadcasterImpl ()
 
const char * GetHijackingListenerName ()
 

Protected Attributes

lldb::ProcessWP m_process_wp
 The process that owns this thread.
 
lldb::StopInfoSP m_stop_info_sp
 The private stop reason for this thread.
 
uint32_t m_stop_info_stop_id
 
uint32_t m_stop_info_override_stop_id
 
bool m_should_run_before_public_stop
 
const uint32_t m_index_id
 A unique 1 based index assigned to each thread for easy UI/command line access.
 
lldb::RegisterContextSP m_reg_context_sp
 The register context for this thread's current register state.
 
lldb::StateType m_state
 The state of our process.
 
std::recursive_mutex m_state_mutex
 Multithreaded protection for m_state.
 
std::recursive_mutex m_frame_mutex
 Multithreaded protection for m_state.
 
lldb::StackFrameListSP m_curr_frames_sp
 The stack frames that get lazily populated after a thread stops.
 
lldb::StackFrameListSP m_prev_frames_sp
 The previous stack frames from the last time this thread stopped.
 
std::optional< lldb::addr_tm_prev_framezero_pc
 Frame 0's PC the last time this thread was stopped.
 
int m_resume_signal
 The signal that should be used when continuing this thread.
 
lldb::StateType m_resume_state
 This state is used to force a thread to be suspended from outside the ThreadPlan logic.
 
lldb::StateType m_temporary_resume_state
 This state records what the thread was told to do by the thread plan logic for the current resume.
 
std::unique_ptr< lldb_private::Unwindm_unwinder_up
 It gets set in Thread::ShouldResume.
 
bool m_destroy_called
 
LazyBool m_override_should_notify
 
std::unique_ptr< ThreadPlanStackm_null_plan_stack_up
 
- Protected Attributes inherited from lldb_private::Properties
lldb::OptionValuePropertiesSP m_collection_sp
 
- Protected Attributes inherited from lldb_private::UserID
lldb::user_id_t m_uid
 The user ID that uniquely identifies an object.
 

Private Member Functions

void BroadcastSelectedFrameChange (StackID &new_frame_id)
 
 Thread (const Thread &)=delete
 
const Threadoperator= (const Thread &)=delete
 

Private Attributes

bool m_extended_info_fetched
 
StructuredData::ObjectSP m_extended_info
 

Friends

class ThreadPlan
 
class ThreadList
 
class ThreadEventData
 
class StackFrameList
 
class StackFrame
 
class OperatingSystem
 

Additional Inherited Members

- Protected Types inherited from lldb_private::Broadcaster
typedef std::shared_ptr< BroadcasterImplBroadcasterImplSP
 
typedef std::weak_ptr< BroadcasterImplBroadcasterImplWP
 

Detailed Description

Definition at line 65 of file Thread.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Broadcaster event bits definitions.

Enumerator
eBroadcastBitStackChanged 
eBroadcastBitThreadSuspended 
eBroadcastBitThreadResumed 
eBroadcastBitSelectedFrameChanged 
eBroadcastBitThreadSelected 

Definition at line 72 of file Thread.h.

Constructor & Destructor Documentation

◆ Thread() [1/2]

Thread::Thread ( Process process,
lldb::tid_t  tid,
bool  use_invalid_index_id = false 
)

Constructor.

Parameters
[in]use_invalid_index_idOptional parameter, defaults to false. The only subclass that is likely to set use_invalid_index_id == true is the HistoryThread class. In that case, the Thread we are constructing represents a thread from earlier in the program execution. We may have the tid of the original thread that they represent but we don't want to reuse the IndexID of that thread, or create a new one. If a client wants to know the original thread's IndexID, they should use Thread::GetExtendedBacktraceOriginatingIndexID().

Definition at line 219 of file Thread.cpp.

References lldb_private::Broadcaster::CheckInWithManager(), lldb_private::UserID::GetID(), lldb_private::GetLog(), LLDB_LOGF, and lldb_private::Object.

◆ ~Thread()

Thread::~Thread ( )
override

If you hit this assert, it means your derived class forgot to call DestroyThread in its destructor.

Definition at line 242 of file Thread.cpp.

References lldb_private::UserID::GetID(), lldb_private::GetLog(), LLDB_LOGF, m_destroy_called, and lldb_private::Object.

◆ Thread() [2/2]

lldb_private::Thread::Thread ( const Thread )
privatedelete

Member Function Documentation

◆ AutoCompleteThreadPlans()

void Thread::AutoCompleteThreadPlans ( CompletionRequest request) const

◆ BroadcastSelectedFrameChange()

void Thread::BroadcastSelectedFrameChange ( StackID new_frame_id)
private

◆ CalculateExecutionContext()

void Thread::CalculateExecutionContext ( ExecutionContext exe_ctx)
overridevirtual

◆ CalculateProcess()

ProcessSP Thread::CalculateProcess ( )
overridevirtual

◆ CalculatePublicStopInfo()

void Thread::CalculatePublicStopInfo ( )

Definition at line 380 of file Thread.cpp.

References GetStopInfo(), ResetStopInfo(), and SetStopInfo().

◆ CalculateStackFrame()

StackFrameSP Thread::CalculateStackFrame ( )
overridevirtual

Implements lldb_private::ExecutionContextScope.

Definition at line 1420 of file Thread.cpp.

◆ CalculateStopInfo()

virtual bool lldb_private::Thread::CalculateStopInfo ( )
pure virtual

Ask the thread subclass to set its stop info.

Thread subclasses should call Thread::SetStopInfo(...) with the reason the thread stopped.

A thread that is sitting at a breakpoint site, but has not yet executed the breakpoint instruction, should have a breakpoint-hit StopInfo set. When execution is resumed, any thread sitting at a breakpoint site will instruction-step over the breakpoint instruction silently, and we will never record this breakpoint as being hit, updating the hit count, possibly executing breakpoint commands or conditions.

Returns
True if Thread::SetStopInfo(...) was called, false otherwise.

Implemented in ThreadElfCore, ThreadFreeBSDKernel, lldb_private::process_gdb_remote::ThreadGDBRemote, ThreadMachCore, ThreadKDP, lldb_private::minidump::ThreadMinidump, lldb_private::ScriptedThread, lldb_private::HistoryThread, ThreadMemory, lldb_private::TargetThreadWindows, and lldb_private::ThreadPostMortemTrace.

Referenced by GetPrivateStopInfo().

◆ CalculateTarget()

TargetSP Thread::CalculateTarget ( )
overridevirtual

◆ CalculateThread()

ThreadSP Thread::CalculateThread ( )
overridevirtual

Implements lldb_private::ExecutionContextScope.

Definition at line 1418 of file Thread.cpp.

◆ CheckpointThreadState()

bool Thread::CheckpointThreadState ( ThreadStateCheckpoint saved_state)
virtual

◆ ClearBackingThread()

virtual void lldb_private::Thread::ClearBackingThread ( )
inlinevirtual

Reimplemented in ThreadMemory.

Definition at line 476 of file Thread.h.

◆ ClearStackFrames()

void Thread::ClearStackFrames ( )
virtual

◆ CompletedPlanOverridesBreakpoint()

bool Thread::CompletedPlanOverridesBreakpoint ( ) const

Check if we have completed plan to override breakpoint stop reason.

Returns
Returns true if completed plan stack is not empty false otherwise.

Definition at line 1167 of file Thread.cpp.

References lldb_private::ThreadPlanStack::AnyCompletedPlans(), and GetPlans().

◆ CreateRegisterContextForFrame()

virtual lldb::RegisterContextSP lldb_private::Thread::CreateRegisterContextForFrame ( StackFrame frame)
pure virtual

◆ DecrementCurrentInlinedDepth()

bool lldb_private::Thread::DecrementCurrentInlinedDepth ( )
inline

◆ DestroyThread()

void Thread::DestroyThread ( )
protectedvirtual

◆ DidResume()

void Thread::DidResume ( )
virtual

Reimplemented in ThreadMemory.

Definition at line 735 of file Thread.cpp.

References LLDB_INVALID_SIGNAL_NUMBER, SetResumeSignal(), and SetShouldRunBeforePublicStop().

◆ DidStop()

void Thread::DidStop ( )
virtual

Reimplemented in lldb_private::TargetThreadWindows.

Definition at line 741 of file Thread.cpp.

References lldb::eStateStopped, and SetState().

◆ DiscardPlan()

void Thread::DiscardPlan ( )
protected

◆ DiscardThreadPlans()

void Thread::DiscardThreadPlans ( bool  force)

Discards the plans queued on the plan stack of the current thread.

This is arbitrated by the "Controlling" ThreadPlans, using the "OkayToDiscard" call.

Definition at line 1228 of file Thread.cpp.

References lldb_private::ThreadPlanStack::DiscardAllPlans(), lldb_private::ThreadPlanStack::DiscardConsultingControllingPlans(), lldb_private::UserID::GetID(), lldb_private::GetLog(), GetPlans(), LLDB_LOGF, and lldb_private::Step.

Referenced by QueueThreadPlan(), ReturnFromFrame(), and lldb_private::ThreadPlanBase::ShouldStop().

◆ DiscardThreadPlansUpToPlan() [1/2]

void Thread::DiscardThreadPlansUpToPlan ( lldb::ThreadPlanSP up_to_plan_sp)

Discards the plans queued on the plan stack of the current thread up to and including up_to_plan_sp.

Definition at line 1215 of file Thread.cpp.

References DiscardThreadPlansUpToPlan().

Referenced by DiscardThreadPlansUpToPlan(), DiscardUserThreadPlansUpToIndex(), QueueThreadPlan(), lldb_private::Process::RunThreadPlan(), and UnwindInnermostExpression().

◆ DiscardThreadPlansUpToPlan() [2/2]

void Thread::DiscardThreadPlansUpToPlan ( ThreadPlan up_to_plan_ptr)

◆ DiscardUserThreadPlansUpToIndex()

bool Thread::DiscardUserThreadPlansUpToIndex ( uint32_t  thread_index)

Discards the plans queued on the plan stack of the current thread up to and including the plan in that matches thread_index counting only the non-Private plans.

Parameters
[in]thread_indexDiscard all plans up to and including this user plan given by this index.
Returns
true if there was a thread plan with that user index, false otherwise.

Definition at line 1203 of file Thread.cpp.

References DiscardThreadPlansUpToPlan(), lldb_private::ThreadPlanStack::GetPlanByIndex(), and GetPlans().

Referenced by CommandObjectThreadPlanDiscard::DoExecute().

◆ DumpTraceInstructions()

void lldb_private::Thread::DumpTraceInstructions ( Stream s,
size_t  count,
size_t  start_position = 0 
) const

Dump count instructions of the thread's Trace starting at the start_position position in reverse order.

The instructions are indexed in reverse order, which means that the start_position 0 represents the last instruction of the trace chronologically.

Parameters
[in]sThe stream object where the instructions are printed.
[in]countThe number of instructions to print.
[in]start_positionThe position of the first instruction to print.

◆ DumpUsingFormat()

bool Thread::DumpUsingFormat ( Stream strm,
uint32_t  frame_idx,
const FormatEntity::Entry format 
)

Print a description of this thread using the provided thread format.

Parameters
[out]strmThe Stream to print the description to.
[in]frame_idxIf not LLDB_INVALID_FRAME_ID, then use this frame index as context to generate the description.
[in]formatThe input format.
Returns
true if and only if dumping with the given format worked.

Definition at line 1631 of file Thread.cpp.

References lldb_private::FormatEntity::Format(), lldb_private::ExecutionContext::GetProcessPtr(), GetStackFrameAtIndex(), LLDB_INVALID_FRAME_ID, and lldb_private::ExecutionContext::SetFrameSP().

Referenced by DumpUsingSettingsFormat(), and lldb::SBThread::GetDescriptionWithFormat().

◆ DumpUsingSettingsFormat()

void Thread::DumpUsingSettingsFormat ( Stream strm,
uint32_t  frame_idx,
bool  stop_format 
)

◆ FetchThreadExtendedInfo()

virtual lldb_private::StructuredData::ObjectSP lldb_private::Thread::FetchThreadExtendedInfo ( )
inlineprotectedvirtual

Reimplemented in lldb_private::process_gdb_remote::ThreadGDBRemote, and lldb_private::ScriptedThread.

Definition at line 1287 of file Thread.h.

Referenced by GetExtendedInfo().

◆ Flush()

void Thread::Flush ( )

◆ FrameSelectedCallback()

void Thread::FrameSelectedCallback ( lldb_private::StackFrame frame)
protected

◆ GetAssociatedWithLibdispatchQueue()

virtual lldb_private::LazyBool lldb_private::Thread::GetAssociatedWithLibdispatchQueue ( )
inlinevirtual

Whether this thread can be associated with a libdispatch queue.

The Thread may know if it is associated with a libdispatch queue, it may know definitively that it is NOT associated with a libdispatch queue, or it may be unknown whether it is associated with a libdispatch queue.

Returns
eLazyBoolNo if this thread is definitely not associated with a libdispatch queue (e.g. on a non-Darwin system where GCD aka libdispatch is not available).

eLazyBoolYes this thread is associated with a libdispatch queue.

eLazyBoolCalculate this thread may be associated with a libdispatch queue but the thread doesn't know one way or the other.

Reimplemented in lldb_private::process_gdb_remote::ThreadGDBRemote.

Definition at line 303 of file Thread.h.

References lldb_private::eLazyBoolNo.

◆ GetBackingThread()

virtual lldb::ThreadSP lldb_private::Thread::GetBackingThread ( ) const
inlinevirtual

Reimplemented in ThreadMemory.

Definition at line 474 of file Thread.h.

Referenced by ShouldResume().

◆ GetBroadcasterClass()

llvm::StringRef lldb_private::Thread::GetBroadcasterClass ( ) const
inlineoverridevirtual

This needs to be filled in if you are going to register the broadcaster with the broadcaster manager and do broadcaster class matching.

FIXME: Probably should make a ManagedBroadcaster subclass with all the bits needed to work with the BroadcasterManager, so that it is clearer how to add one.

Reimplemented from lldb_private::Broadcaster.

Definition at line 82 of file Thread.h.

References GetStaticBroadcasterClass().

◆ GetCompletedPlan()

ThreadPlanSP Thread::GetCompletedPlan ( ) const

Gets the outer-most plan that was popped off the plan stack in the most recent stop.

Useful for printing the stop reason accurately.

Returns
A pointer to the last completed plan.

Definition at line 1147 of file Thread.cpp.

References lldb_private::ThreadPlanStack::GetCompletedPlan(), and GetPlans().

Referenced by GetStopInfo(), and ShouldReportRun().

◆ GetCurrentException()

ValueObjectSP Thread::GetCurrentException ( )

Definition at line 2040 of file Thread.cpp.

References GetProcess(), and GetStackFrameAtIndex().

Referenced by GetCurrentExceptionBacktrace().

◆ GetCurrentExceptionBacktrace()

ThreadSP Thread::GetCurrentExceptionBacktrace ( )

Definition at line 2056 of file Thread.cpp.

References GetCurrentException(), and GetProcess().

◆ GetCurrentInlinedDepth()

uint32_t lldb_private::Thread::GetCurrentInlinedDepth ( )
inline

◆ GetCurrentPlan()

ThreadPlan * Thread::GetCurrentPlan ( ) const

◆ GetDescription()

bool Thread::GetDescription ( Stream s,
lldb::DescriptionLevel  level,
bool  print_json_thread,
bool  print_json_stopinfo 
)

◆ GetExpressionVariable()

ExpressionVariableSP Thread::GetExpressionVariable ( ) const

Gets the outer-most expression variable from the completed plans.

Returns
A ExpressionVariableSP, either empty if there is no plan completed an expression during the current stop or the expression variable that was made for the completed expression.

Definition at line 1155 of file Thread.cpp.

References lldb_private::ThreadPlanStack::GetExpressionVariable(), and GetPlans().

Referenced by GetStopInfo().

◆ GetExtendedBacktraceOriginatingIndexID()

virtual uint32_t lldb_private::Thread::GetExtendedBacktraceOriginatingIndexID ( )
inlinevirtual

Reimplemented in lldb_private::HistoryThread.

Definition at line 1105 of file Thread.h.

References GetIndexID().

◆ GetExtendedBacktraceToken()

virtual uint64_t lldb_private::Thread::GetExtendedBacktraceToken ( )
inlinevirtual

Gets the extended backtrace token for this thread.

Some Thread subclasses may maintain a token to help with providing an extended backtrace. The SystemRuntime plugin will set/request this.

Returns
The token needed by the SystemRuntime to create an extended backtrace. LLDB_INVALID_ADDRESS is returned if no token is available.

Reimplemented in lldb_private::HistoryThread.

Definition at line 1232 of file Thread.h.

References LLDB_INVALID_ADDRESS.

◆ GetExtendedInfo()

StructuredData::ObjectSP lldb_private::Thread::GetExtendedInfo ( )
inline

Retrieve a dictionary of information about this thread.

On Mac OS X systems there may be voucher information. The top level dictionary returned will have an "activity" key and the value of the activity is a dictionary. Keys in that dictionary will be "name" and "id", among others. There may also be "trace_messages" (an array) with each entry in that array being a dictionary (keys include "message" with the text of the trace message).

Definition at line 275 of file Thread.h.

References FetchThreadExtendedInfo(), m_extended_info, and m_extended_info_fetched.

Referenced by lldb_private::FormatEntity::Format(), GetDescription(), and lldb::SBThread::GetInfoItemByPathAsString().

◆ GetFrameWithConcreteFrameIndex()

lldb::StackFrameSP Thread::GetFrameWithConcreteFrameIndex ( uint32_t  unwind_idx)
virtual

Definition at line 1460 of file Thread.cpp.

References GetStackFrameList().

Referenced by lldb_private::RegisterContext::SetPC().

◆ GetFrameWithStackID()

virtual lldb::StackFrameSP lldb_private::Thread::GetFrameWithStackID ( const StackID stack_id)
inlinevirtual

◆ GetGlobalProperties()

ThreadProperties & Thread::GetGlobalProperties ( )
static

◆ GetIndexID()

uint32_t Thread::GetIndexID ( ) const

◆ GetInfo()

virtual const char * lldb_private::Thread::GetInfo ( )
inlinevirtual

Reimplemented in lldb_private::ScriptedThread, and ThreadMemory.

Definition at line 263 of file Thread.h.

◆ GetName()

virtual const char * lldb_private::Thread::GetName ( )
inlinevirtual

◆ GetPlans()

ThreadPlanStack & Thread::GetPlans ( ) const
protected

◆ GetPreviousFrameZeroPC()

std::optional< addr_t > Thread::GetPreviousFrameZeroPC ( )

Request the pc value the thread had when previously stopped.

When the thread performs execution, it copies the current RegisterContext GetPC() value. This method returns that value, if it is available.

Returns
The PC value before execution was resumed. May not be available; an empty std::optional is returned in that case.

Definition at line 1436 of file Thread.cpp.

References m_prev_framezero_pc.

Referenced by lldb_private::StopInfoMachException::WasContinueInterrupted().

◆ GetPreviousPlan()

ThreadPlan * Thread::GetPreviousPlan ( ThreadPlan plan) const
protected

◆ GetPrivateStopInfo()

lldb::StopInfoSP Thread::GetPrivateStopInfo ( bool  calculate = true)
virtual

◆ GetProcess()

lldb::ProcessSP lldb_private::Thread::GetProcess ( ) const
inline

Definition at line 157 of file Thread.h.

References m_process_wp.

Referenced by lldb_private::UnwindLLDB::AddFirstFrame(), UnwindAssembly_x86::AugmentUnwindPlanFromCallSite(), CalculateProcess(), ThreadElfCore::CalculateStopInfo(), lldb_private::process_gdb_remote::ThreadGDBRemote::CalculateStopInfo(), ThreadMachCore::CalculateStopInfo(), ThreadKDP::CalculateStopInfo(), ThreadMemory::CalculateStopInfo(), CalculateTarget(), lldb_private::process_gdb_remote::ProcessGDBRemote::CalculateThreadStopInfo(), CheckpointThreadState(), lldb_private::ThreadPlanCallFunction::ConstructorSetup(), ThreadElfCore::CreateRegisterContextForFrame(), ThreadFreeBSDKernel::CreateRegisterContextForFrame(), ThreadMachCore::CreateRegisterContextForFrame(), lldb_private::process_gdb_remote::ThreadGDBRemote::CreateRegisterContextForFrame(), lldb_private::minidump::ThreadMinidump::CreateRegisterContextForFrame(), lldb_private::ThreadPostMortemTrace::CreateRegisterContextForFrame(), lldb_private::StopInfoMachException::CreateStopReasonWithMachException(), lldb_private::StopInfo::CreateStopReasonWithSignal(), lldb_private::UnwindLLDB::DoCreateRegisterContextForFrame(), CommandObjectThreadBacktrace::DoExtendedBacktrace(), lldb_private::UnwindLLDB::DoGetFrameCount(), lldb_private::UnwindLLDB::DoGetFrameInfoAtIndex(), lldb_private::AppleThreadPlanStepThroughDirectDispatch::DoPlanExplainsStop(), lldb_private::TargetThreadWindows::DoResume(), lldb_private::StopInfoWatchpoint::ThreadPlanStepOverWatchpoint::DoWillResume(), lldb_private::StackFrameList::FetchFramesUpTo(), lldb_private::process_gdb_remote::ThreadGDBRemote::FetchThreadExtendedInfo(), lldb_private::FormatEntity::Format(), FrameSelectedCallback(), lldb_private::process_gdb_remote::GDBRemoteRegisterContext::GDBRemoteRegisterContext(), ABIMacOSX_i386::GetArgumentValues(), ABISysV_i386::GetArgumentValues(), GetByteOrderAndAddrSize(), GetCurrentException(), GetCurrentExceptionBacktrace(), lldb_private::HistoryThread::GetExtendedBacktraceOriginatingIndexID(), UnwindAssembly_x86::GetFastUnwindPlan(), UnwindAssembly_x86::GetNonCallSiteUnwindPlanFromAssembly(), GetPlans(), GetPrivateStopInfo(), lldb_private::process_gdb_remote::ThreadGDBRemote::GetQueue(), lldb_private::process_gdb_remote::ThreadGDBRemote::GetQueueID(), lldb_private::process_gdb_remote::ThreadGDBRemote::GetQueueKind(), lldb_private::process_gdb_remote::ThreadGDBRemote::GetQueueLibdispatchQueueAddress(), lldb_private::process_gdb_remote::ThreadGDBRemote::GetQueueName(), lldb_private::HistoryThread::GetRegisterContext(), lldb_private::RegisterContextUnwind::GetReturnAddressHint(), ABIMacOSX_arm::GetReturnValueObjectImpl(), ABISysV_arm::GetReturnValueObjectImpl(), ABISysV_riscv::GetReturnValueObjectImpl(), ABISysV_loongarch::GetReturnValueObjectSimple(), ABISysV_ppc::GetReturnValueObjectSimple(), ABISysV_riscv::GetReturnValueObjectSimple(), ABISysV_i386::GetReturnValueObjectSimple(), ABISysV_x86_64::GetReturnValueObjectSimple(), ABIWindows_x86_64::GetReturnValueObjectSimple(), GetReturnValuePassedInMemory(), lldb_private::LanguageRuntime::GetRuntimeUnwindPlan(), lldb_private::process_gdb_remote::ThreadGDBRemote::GetSiginfo(), GetSiginfoValue(), lldb_private::RegisterContextUnwind::GetStartPC(), lldb_private::StackFrameList::GetStatus(), GetStatus(), lldb_private::AppleObjCTrampolineHandler::GetStepThroughDispatchPlan(), DynamicLoaderHexagonDYLD::GetStepThroughTrampolinePlan(), lldb_private::DynamicLoaderDarwin::GetStepThroughTrampolinePlan(), DynamicLoaderPOSIXDYLD::GetStepThroughTrampolinePlan(), GetStopInfo(), GetStopInfoForHardwareBP(), GetThreadLocalData(), GetValObjFromIntRegs(), lldb_private::RegisterContext::InvalidateIfNeeded(), ABISysV_arm::IsArmHardFloat(), IsStillAtLastBreakpointHit(), lldb_private::StopInfoBreakpoint::IsValidForOperatingSystemThread(), lldb_private::ScriptedThread::LoadArtificialStackFrames(), lldb_private::ThreadPlanStepThrough::LookForPlanToStepThroughFromCurrentPC(), lldb_private::ArchitectureArm::OverrideStopInfo(), ABISysV_ppc::PrepareTrivialCall(), ABISysV_ppc64::PrepareTrivialCall(), ABISysV_s390x::PrepareTrivialCall(), ABISysV_x86_64::PrepareTrivialCall(), ABIWindows_x86_64::PrepareTrivialCall(), lldb_private::RegisterContextUnwind::ReadFrameAddress(), lldb_private::RegisterContextUnwind::ReadGPRValue(), ReadIntegerArgument(), lldb_private::RegisterContextUnwind::ReadPC(), RegisterContextDarwin_arm64::ReadRegister(), lldb_private::RegisterContextUnwind::ReadRegister(), RegisterContextFreeBSDKernel_arm64::ReadRegister(), RegisterContextFreeBSDKernel_i386::ReadRegister(), RegisterContextFreeBSDKernel_x86_64::ReadRegister(), lldb_private::RegisterContext::ReadRegisterValueFromMemory(), lldb_private::AbortWithPayloadFrameRecognizer::RecognizeFrame(), RegisterContextCorePOSIX_arm64::RegisterContextCorePOSIX_arm64(), lldb_private::StopInfoWatchpoint::ThreadPlanStepOverWatchpoint::ResetWatchpoint(), ReturnFromFrame(), lldb_private::ExpressionParser::RunStaticInitializers(), SafeToCallFunctions(), lldb_private::StackFrameList::SelectMostRelevantFrame(), lldb_private::StackFrameList::SetDefaultFileAndLineToSelectedFrame(), SetSelectedFrameByIndexNoisily(), SetStopInfo(), lldb_private::AppleObjCTrampolineHandler::SetupDispatchFunction(), SetupForResume(), lldb_private::AppleGetItemInfoHandler::SetupGetItemInfoFunction(), lldb_private::AppleGetPendingItemsHandler::SetupGetPendingItemsFunction(), lldb_private::AppleGetQueuesHandler::SetupGetQueuesFunction(), lldb_private::AppleGetThreadItemInfoHandler::SetupGetThreadItemInfoFunction(), ShouldResume(), ShouldStop(), lldb_private::AppleThreadPlanStepThroughObjCTrampoline::ShouldStop(), lldb_private::AppleThreadPlanStepThroughDirectDispatch::ShouldStop(), StepIn(), StepOut(), StepOver(), StopInfoIsUpToDate(), lldb_private::ThreadPlanRunToAddress::ThreadPlanRunToAddress(), lldb_private::ThreadPlanStepOverBreakpoint::ThreadPlanStepOverBreakpoint(), lldb_private::RegisterContextUnwind::TryFallbackUnwindPlan(), lldb_private::UnwindLLDB::UnwindLLDB(), lldb_private::StopInfoMachException::WasContinueInterrupted(), lldb_private::process_gdb_remote::ThreadGDBRemote::WillResume(), lldb_private::process_gdb_remote::GDBRemoteRegisterContext::WriteAllRegisterValues(), lldb_private::RegisterContext::WriteRegisterValueToMemory(), and lldb_private::process_gdb_remote::ThreadGDBRemote::~ThreadGDBRemote().

◆ GetProtocolID()

virtual lldb::user_id_t lldb_private::Thread::GetProtocolID ( ) const
inlinevirtual

◆ GetQueue()

virtual lldb::QueueSP lldb_private::Thread::GetQueue ( )
inlinevirtual

Retrieve the Queue for this thread, if any.

Returns
A QueueSP for the queue that is currently associated with this thread. An empty shared pointer indicates that this thread is not associated with a queue, or libdispatch queues are not supported on this target.

Reimplemented in lldb_private::process_gdb_remote::ThreadGDBRemote.

Definition at line 361 of file Thread.h.

Referenced by lldb::SBThread::GetQueue().

◆ GetQueueID()

virtual lldb::queue_id_t lldb_private::Thread::GetQueueID ( )
inlinevirtual

Retrieve the Queue ID for the queue currently using this Thread.

If this Thread is doing work on behalf of a libdispatch/GCD queue, retrieve the QueueID.

This is a unique identifier for the libdispatch/GCD queue in a process. Often starting at 1 for the initial system-created queues and incrementing, a QueueID will not be reused for a different queue during the lifetime of a process.

Returns
A QueueID if the Thread subclass implements this, else LLDB_INVALID_QUEUE_ID.

Reimplemented in lldb_private::process_gdb_remote::ThreadGDBRemote, and lldb_private::HistoryThread.

Definition at line 323 of file Thread.h.

References LLDB_INVALID_QUEUE_ID.

Referenced by lldb::SBThread::GetQueueID().

◆ GetQueueKind()

virtual lldb::QueueKind lldb_private::Thread::GetQueueKind ( )
inlinevirtual

Retrieve the Queue kind for the queue currently using this Thread.

If this Thread is doing work on behalf of a libdispatch/GCD queue, retrieve the Queue kind - either eQueueKindSerial or eQueueKindConcurrent, indicating that this queue processes work items serially or concurrently.

Returns
The Queue kind, if the Thread subclass implements this, else eQueueKindUnknown.

Reimplemented in lldb_private::process_gdb_remote::ThreadGDBRemote.

Definition at line 349 of file Thread.h.

References lldb::eQueueKindUnknown.

◆ GetQueueLibdispatchQueueAddress()

virtual lldb::addr_t lldb_private::Thread::GetQueueLibdispatchQueueAddress ( )
inlinevirtual

Retrieve the address of the libdispatch_queue_t struct for queue currently using this Thread.

If this Thread is doing work on behalf of a libdispatch/GCD queue, retrieve the address of the libdispatch_queue_t structure describing the queue.

This address may be reused for different queues later in the Process lifetime and should not be used to identify a queue uniquely. Use the GetQueueID() call for that.

Returns
The Queue's libdispatch_queue_t address if the Thread subclass implements this, else LLDB_INVALID_ADDRESS.

Reimplemented in lldb_private::process_gdb_remote::ThreadGDBRemote.

Definition at line 377 of file Thread.h.

References LLDB_INVALID_ADDRESS.

◆ GetQueueName()

virtual const char * lldb_private::Thread::GetQueueName ( )
inlinevirtual

Retrieve the Queue name for the queue currently using this Thread.

If this Thread is doing work on behalf of a libdispatch/GCD queue, retrieve the Queue name.

Returns
The Queue name, if the Thread subclass implements this, else nullptr.

Reimplemented in lldb_private::process_gdb_remote::ThreadGDBRemote, ThreadKDP, lldb_private::ScriptedThread, lldb_private::HistoryThread, and ThreadMemory.

Definition at line 335 of file Thread.h.

Referenced by lldb_private::FormatEntity::Format(), lldb::SBThread::GetQueueName(), and lldb_private::ThreadSpec::QueueNameMatches().

◆ GetRegisterContext()

virtual lldb::RegisterContextSP lldb_private::Thread::GetRegisterContext ( )
pure virtual

Implemented in ThreadElfCore, ThreadFreeBSDKernel, lldb_private::process_gdb_remote::ThreadGDBRemote, ThreadMachCore, ThreadKDP, lldb_private::minidump::ThreadMinidump, lldb_private::ScriptedThread, lldb_private::HistoryThread, ThreadMemory, lldb_private::TargetThreadWindows, and lldb_private::ThreadPostMortemTrace.

Referenced by lldb_private::ThreadPlanRunToAddress::AtOurAddress(), UnwindAssembly_x86::AugmentUnwindPlanFromCallSite(), ClearStackFrames(), lldb_private::ThreadPlanCallFunction::ConstructorSetup(), lldb_private::RegisterContextUnwind::ConvertRegisterKindToRegisterNumber(), lldb_private::RegisterContext::CopyFromRegisterContext(), RegisterContextDarwin_x86_64_Mach::Create_LC_THREAD(), RegisterContextDarwin_i386_Mach::Create_LC_THREAD(), RegisterContextDarwin_arm_Mach::Create_LC_THREAD(), RegisterContextDarwin_arm64_Mach::Create_LC_THREAD(), lldb_private::StopInfoMachException::CreateStopReasonWithMachException(), lldb_private::ProcessWindows::DisableWatchpoint(), lldb_private::UnwindLLDB::DoCreateRegisterContextForFrame(), lldb_private::ThreadPlanStepOverBreakpoint::DoPlanExplainsStop(), lldb_private::ThreadPlanStepOverRange::DoWillResume(), lldb_private::ProcessWindows::EnableWatchpoint(), lldb_private::StackFrameList::FetchFramesUpTo(), ABIMacOSX_arm64::GetArgumentValues(), ABISysV_arm64::GetArgumentValues(), ABIMacOSX_arm::GetArgumentValues(), ABISysV_arm::GetArgumentValues(), ABISysV_ppc::GetArgumentValues(), ABISysV_ppc64::GetArgumentValues(), ABISysV_s390x::GetArgumentValues(), ABIMacOSX_i386::GetArgumentValues(), ABISysV_i386::GetArgumentValues(), ABISysV_x86_64::GetArgumentValues(), ABIWindows_x86_64::GetArgumentValues(), lldb_private::StackFrameList::GetCurrentInlinedDepth(), UnwindAssembly_x86::GetNonCallSiteUnwindPlanFromAssembly(), lldb_private::RegisterContextUnwind::GetRegisterCount(), lldb_private::UnwindPlan::GetRegisterInfo(), lldb_private::RegisterContextUnwind::GetRegisterInfoAtIndex(), lldb_private::RegisterContextUnwind::GetRegisterSet(), lldb_private::RegisterContextUnwind::GetRegisterSetCount(), ABIMacOSX_arm64::GetReturnValueObjectImpl(), ABISysV_arm64::GetReturnValueObjectImpl(), ABIMacOSX_arm::GetReturnValueObjectImpl(), ABISysV_arm::GetReturnValueObjectImpl(), ABIMacOSX_i386::GetReturnValueObjectImpl(), ABISysV_mips::GetReturnValueObjectImpl(), ABISysV_mips64::GetReturnValueObjectImpl(), ABISysV_ppc::GetReturnValueObjectImpl(), ABISysV_s390x::GetReturnValueObjectImpl(), ABISysV_i386::GetReturnValueObjectImpl(), ABISysV_x86_64::GetReturnValueObjectImpl(), ABIWindows_x86_64::GetReturnValueObjectImpl(), ABISysV_arc::GetReturnValueObjectImpl(), ABISysV_hexagon::GetReturnValueObjectImpl(), ABISysV_riscv::GetReturnValueObjectImpl(), ABISysV_arc::GetReturnValueObjectSimple(), ABISysV_loongarch::GetReturnValueObjectSimple(), ABISysV_ppc::GetReturnValueObjectSimple(), ABISysV_riscv::GetReturnValueObjectSimple(), ABISysV_s390x::GetReturnValueObjectSimple(), ABISysV_i386::GetReturnValueObjectSimple(), ABISysV_x86_64::GetReturnValueObjectSimple(), ABIWindows_x86_64::GetReturnValueObjectSimple(), lldb_private::AppleObjCTrampolineHandler::GetStepThroughDispatchPlan(), lldb_private::DynamicLoaderWindowsDYLD::GetStepThroughTrampolinePlan(), lldb_private::CPPLanguageRuntime::GetStepThroughTrampolinePlan(), lldb_private::FuncUnwinders::GetSymbolFileUnwindPlan(), RegisterNumber::init(), lldb_private::RegisterContextUnwind::InitializeNonZerothFrame(), lldb_private::RegisterContextUnwind::InitializeZerothFrame(), lldb_private::ThreadPlanStepRange::InRange(), lldb_private::ThreadPlanStepRange::InSymbol(), lldb_private::ThreadPlanShouldStopHere::InvokeShouldStopHereCallback(), lldb_private::ThreadPlanStepInstruction::IsPlanStale(), lldb_private::ThreadPlanStepOverBreakpoint::IsPlanStale(), lldb_private::ThreadPlanStepRange::IsPlanStale(), IsStillAtLastBreakpointHit(), lldb_private::ThreadPlanAssemblyTracer::Log(), lldb_private::ThreadPlanStepThrough::LookForPlanToStepThroughFromCurrentPC(), lldb_private::ThreadPlanStepOverBreakpoint::MischiefManaged(), lldb_private::ArchitectureArm::OverrideStopInfo(), ABIMacOSX_i386::PrepareTrivialCall(), ABIMacOSX_arm::PrepareTrivialCall(), ABISysV_arm::PrepareTrivialCall(), ABIMacOSX_arm64::PrepareTrivialCall(), ABISysV_arm64::PrepareTrivialCall(), ABISysV_loongarch::PrepareTrivialCall(), ABISysV_mips::PrepareTrivialCall(), ABISysV_mips64::PrepareTrivialCall(), ABISysV_ppc::PrepareTrivialCall(), ABISysV_ppc64::PrepareTrivialCall(), ABISysV_s390x::PrepareTrivialCall(), ABISysV_i386::PrepareTrivialCall(), ABISysV_x86_64::PrepareTrivialCall(), ABIWindows_x86_64::PrepareTrivialCall(), lldb_private::RegisterContextUnwind::ReadGPRValue(), ReadIntegerArgument(), lldb_private::RegisterContextUnwind::ReadRegister(), lldb_private::RegisterContextUnwind::ReadRegisterValueFromRegisterLocation(), lldb_private::ThreadPlanCallFunction::ReportRegisterState(), lldb_private::StackFrameList::ResetCurrentInlinedDepth(), lldb_private::Process::RunThreadPlan(), lldb_private::StackFrameList::SetCurrentInlinedDepth(), lldb_private::ThreadPlanStepRange::SetNextBranchBreakpoint(), ABIMacOSX_arm64::SetReturnValueObject(), ABISysV_arm64::SetReturnValueObject(), ABIMacOSX_arm::SetReturnValueObject(), ABISysV_arm::SetReturnValueObject(), ABISysV_mips::SetReturnValueObject(), ABISysV_mips64::SetReturnValueObject(), ABISysV_ppc::SetReturnValueObject(), ABISysV_ppc64::SetReturnValueObject(), ABISysV_s390x::SetReturnValueObject(), ABIMacOSX_i386::SetReturnValueObject(), ABISysV_i386::SetReturnValueObject(), ABISysV_x86_64::SetReturnValueObject(), ABIWindows_x86_64::SetReturnValueObject(), SetupForResume(), lldb_private::ThreadPlanStepInstruction::SetUpState(), ShouldStop(), lldb_private::ThreadPlanStepInRange::ShouldStop(), lldb_private::ThreadPlanStepInstruction::ShouldStop(), lldb_private::ThreadPlanStepOverRange::ShouldStop(), lldb_private::ThreadPlanStepOut::ThreadPlanStepOut(), lldb_private::ThreadPlanStepOverBreakpoint::ThreadPlanStepOverBreakpoint(), lldb_private::ThreadPlanStepThrough::ThreadPlanStepThrough(), lldb_private::StopInfoMachException::WasContinueInterrupted(), lldb_private::ThreadPlan::WillResume(), lldb_private::RegisterContextUnwind::WriteRegister(), and lldb_private::RegisterContextUnwind::WriteRegisterValueToRegisterLocation().

◆ GetResumeSignal()

int lldb_private::Thread::GetResumeSignal ( ) const
inline

Definition at line 159 of file Thread.h.

References m_resume_signal.

Referenced by lldb_private::process_gdb_remote::ThreadGDBRemote::WillResume().

◆ GetResumeState()

lldb::StateType lldb_private::Thread::GetResumeState ( ) const
inline

Gets the USER resume state for this thread.

This is not the same as what this thread is going to do for any particular step, however if this thread returns eStateSuspended, then the process control logic will never allow this thread to run.

Returns
The User resume state for this thread.

Definition at line 201 of file Thread.h.

References m_resume_state.

Referenced by lldb::SBThread::IsSuspended(), SetupForResume(), ShouldReportRun(), ShouldReportStop(), and ShouldStop().

◆ GetReturnValueObject()

ValueObjectSP Thread::GetReturnValueObject ( ) const

Gets the outer-most return value from the completed plans.

Returns
A ValueObjectSP, either empty if there is no return value, or containing the return value.

Definition at line 1151 of file Thread.cpp.

References GetPlans(), and lldb_private::ThreadPlanStack::GetReturnValueObject().

Referenced by GetStopInfo().

◆ GetSelectedFrame()

lldb::StackFrameSP Thread::GetSelectedFrame ( SelectMostRelevant  select_most_relevant)

◆ GetSelectedFrameIndex()

uint32_t lldb_private::Thread::GetSelectedFrameIndex ( SelectMostRelevant  select_most_relevant)
inline

◆ GetSiginfo()

virtual llvm::Expected< std::unique_ptr< llvm::MemoryBuffer > > lldb_private::Thread::GetSiginfo ( size_t  max_size) const
inlineprotectedvirtual

Reimplemented in lldb_private::process_gdb_remote::ThreadGDBRemote.

Definition at line 1300 of file Thread.h.

Referenced by GetSiginfoValue().

◆ GetSiginfoValue()

lldb::ValueObjectSP Thread::GetSiginfoValue ( )

◆ GetStackFrameAtIndex()

virtual lldb::StackFrameSP lldb_private::Thread::GetStackFrameAtIndex ( uint32_t  idx)
inlinevirtual

Definition at line 408 of file Thread.h.

References GetStackFrameList().

Referenced by CommandObjectTargetSymbolsAdd::AddSymbolsForStack(), lldb_private::ThreadPlanStepUntil::AnalyzeStop(), lldb_private::CommandObjectIterateOverThreads::BucketThread(), lldb_private::Process::CallVoidArgVoidPtrReturn(), CheckpointThreadState(), lldb_private::ThreadPlanStepRange::CompareCurrentFrameToStartFrame(), lldb_private::ThreadPlanShouldStopHere::DefaultShouldStopHereCallback(), lldb_private::ThreadPlanStepInRange::DefaultShouldStopHereCallback(), lldb_private::ThreadPlanShouldStopHere::DefaultStepFromHereCallback(), lldb_private::StopInfoMachException::DeterminePtrauthFailure(), CommandObjectFrameSelect::DoExecute(), CommandObjectFrameRecognizerInfo::DoExecute(), CommandObjectThreadStepWithTypeAndScope::DoExecute(), CommandObjectThreadUntil::DoExecute(), lldb_private::ThreadPlanStepOut::DoPlanExplainsStop(), lldb_private::ThreadPlanCallFunction::DoTakedown(), lldb_private::ThreadPlanStepOverRange::DoWillResume(), DumpUsingFormat(), Evaluate_DW_OP_entry_value(), FindMostRelevantFrame(), lldb_private::ThreadPlanStepInRange::FrameMatchesAvoidCriteria(), GetCurrentException(), lldb_private::AppleGetQueuesHandler::GetCurrentQueues(), lldb::SBThread::GetFrameAtIndex(), lldb_private::AppleGetItemInfoHandler::GetItemInfo(), lldb_private::AppleGetPendingItemsHandler::GetPendingItems(), ABIMacOSX_arm64::GetReturnValueObjectImpl(), ABISysV_arm64::GetReturnValueObjectImpl(), ABIMacOSX_arm::GetReturnValueObjectImpl(), ABISysV_arm::GetReturnValueObjectImpl(), ABIMacOSX_i386::GetReturnValueObjectImpl(), ABISysV_mips::GetReturnValueObjectImpl(), ABISysV_mips64::GetReturnValueObjectImpl(), ABISysV_arc::GetReturnValueObjectImpl(), ABISysV_hexagon::GetReturnValueObjectImpl(), ABISysV_riscv::GetReturnValueObjectImpl(), ABISysV_arc::GetReturnValueObjectSimple(), ABISysV_loongarch::GetReturnValueObjectSimple(), ABISysV_ppc::GetReturnValueObjectSimple(), ABISysV_riscv::GetReturnValueObjectSimple(), ABISysV_s390x::GetReturnValueObjectSimple(), ABISysV_i386::GetReturnValueObjectSimple(), ABISysV_x86_64::GetReturnValueObjectSimple(), ABIWindows_x86_64::GetReturnValueObjectSimple(), GetStatus(), lldb_private::AppleObjCTrampolineHandler::GetStepThroughDispatchPlan(), DynamicLoaderHexagonDYLD::GetStepThroughTrampolinePlan(), lldb_private::DynamicLoaderDarwin::GetStepThroughTrampolinePlan(), DynamicLoaderPOSIXDYLD::GetStepThroughTrampolinePlan(), lldb_private::CPPLanguageRuntime::GetStepThroughTrampolinePlan(), GetStopDescription(), lldb_private::AppleGetThreadItemInfoHandler::GetThreadItemInfo(), GetValObjFromFPRegs(), GetValObjFromIntRegs(), lldb_private::ThreadPlanStepThrough::HitOurBackstopBreakpoint(), lldb_private::InferiorCallMmap(), lldb_private::InferiorCallMunmap(), lldb_private::ThreadPlanStepRange::InRange(), lldb_private::ThreadPlanStepInstruction::IsPlanStale(), lldb_private::ThreadPlanStepOut::IsPlanStale(), JumpToLine(), lldb_private::ThreadPlanTracer::Log(), lldb_private::ThreadPlanStepOut::QueueInlinedStepPlan(), RestoreRegisterStateFromCheckpoint(), ReturnFromFrame(), ReturnFromFrameWithIndex(), lldb::SBThread::SetSelectedFrame(), lldb_private::ThreadPlanStepInstruction::SetUpState(), lldb_private::ThreadPlanStepInRange::ShouldStop(), lldb_private::ThreadPlanStepInstruction::ShouldStop(), lldb_private::ThreadPlanStepOut::ShouldStop(), lldb_private::ThreadPlanStepOverRange::ShouldStop(), lldb_private::AppleThreadPlanStepThroughObjCTrampoline::ShouldStop(), StepIn(), lldb::SBThread::StepInto(), StepOver(), lldb::SBThread::StepOver(), lldb::SBThread::StepOverUntil(), lldb_private::ThreadPlanStepOut::ThreadPlanStepOut(), lldb_private::ThreadPlanStepRange::ThreadPlanStepRange(), lldb_private::ThreadPlanStepUntil::ThreadPlanStepUntil(), and lldb_private::ClangExpressionDeclMap::WillParse().

◆ GetStackFrameCount()

virtual uint32_t lldb_private::Thread::GetStackFrameCount ( )
inlinevirtual

GetStackFrameCount can be expensive.

Stacks can get very deep, and they require memory reads for each frame. So only use GetStackFrameCount when you need to know the depth of the stack. When iterating over frames, its better to generate the frames one by one with GetFrameAtIndex, and when that returns NULL, you are at the end of the stack. That way your loop will only do the work it needs to, without forcing lldb to realize StackFrames you weren't going to look at.

Definition at line 404 of file Thread.h.

References GetStackFrameList().

Referenced by CommandObjectTargetSymbolsAdd::AddSymbolsForStack(), lldb_private::CommandObjectIterateOverThreads::BucketThread(), CommandObjectFrameSelect::DoExecute(), and lldb::SBThread::GetNumFrames().

◆ GetStackFrameList()

StackFrameListSP Thread::GetStackFrameList ( )
protected

◆ GetStackFrameSPForStackFramePtr()

lldb::StackFrameSP Thread::GetStackFrameSPForStackFramePtr ( StackFrame stack_frame_ptr)

Definition at line 1705 of file Thread.cpp.

References GetStackFrameList().

◆ GetStackFrameStatus()

size_t Thread::GetStackFrameStatus ( Stream strm,
uint32_t  first_frame,
uint32_t  num_frames,
bool  show_frame_info,
uint32_t  num_frames_with_source,
bool  show_hidden 
)

Definition at line 1906 of file Thread.cpp.

References GetStackFrameList().

Referenced by lldb_private::Process::RunThreadPlan().

◆ GetState()

StateType Thread::GetState ( ) const

Definition at line 565 of file Thread.cpp.

References m_state, and m_state_mutex.

Referenced by lldb_private::TargetThreadWindows::DoResume(), and lldb::SBThread::IsStopped().

◆ GetStaticBroadcasterClass()

llvm::StringRef Thread::GetStaticBroadcasterClass ( )
static

◆ GetStatus()

size_t Thread::GetStatus ( Stream strm,
uint32_t  start_frame,
uint32_t  num_frames,
uint32_t  num_frames_with_source,
bool  stop_format,
bool  show_hidden,
bool  only_stacks = false 
)

◆ GetStopDescription()

std::string Thread::GetStopDescription ( )

Definition at line 576 of file Thread.cpp.

References GetStackFrameAtIndex(), and GetStopDescriptionRaw().

Referenced by lldb::SBThread::GetStopDescription().

◆ GetStopDescriptionRaw()

std::string Thread::GetStopDescriptionRaw ( )

Definition at line 596 of file Thread.cpp.

References lldb::eStopReasonNone, and GetStopInfo().

Referenced by GetStopDescription().

◆ GetStopInfo()

lldb::StopInfoSP Thread::GetStopInfo ( )

◆ GetStopReason()

lldb::StopReason Thread::GetStopReason ( )

Definition at line 441 of file Thread.cpp.

References lldb::eStopReasonNone, and GetStopInfo().

Referenced by lldb::SBThread::GetStopReason().

◆ GetTemporaryResumeState()

lldb::StateType lldb_private::Thread::GetTemporaryResumeState ( ) const
inline

◆ GetThreadLocalData()

addr_t Thread::GetThreadLocalData ( const lldb::ModuleSP  module,
lldb::addr_t  tls_file_addr 
)
virtual

Retrieves the per-module TLS block for a thread.

Parameters
[in]moduleThe module to query TLS data for.
[in]tls_file_addrThe thread local address in module
Returns
If the thread has TLS data allocated for the module, the address of the TLS block. Otherwise LLDB_INVALID_ADDRESS is returned.

Definition at line 1677 of file Thread.cpp.

References GetProcess(), lldb_private::DynamicLoader::GetThreadLocalData(), and LLDB_INVALID_ADDRESS.

Referenced by lldb_private::DWARFExpression::Evaluate().

◆ GetThreadPointer()

lldb::addr_t Thread::GetThreadPointer ( )
virtual

Retrieves the per-thread data area.

Most OSs maintain a per-thread pointer (e.g. the FS register on x64), which we return the value of here.

Returns
LLDB_INVALID_ADDRESS if not supported, otherwise the thread pointer value.

Definition at line 1671 of file Thread.cpp.

References LLDB_INVALID_ADDRESS, and m_reg_context_sp.

◆ GetUnwinder()

Unwind & Thread::GetUnwinder ( )
protectedvirtual

◆ IsOperatingSystemPluginThread()

virtual bool lldb_private::Thread::IsOperatingSystemPluginThread ( ) const
inlineprotectedvirtual

Reimplemented in ThreadMemory.

Definition at line 1283 of file Thread.h.

◆ IsStillAtLastBreakpointHit()

bool Thread::IsStillAtLastBreakpointHit ( )
protectedvirtual

◆ IsThreadPlanDone()

bool Thread::IsThreadPlanDone ( ThreadPlan plan) const

Checks whether the given plan is in the completed plans for this stop.

Parameters
[in]planPointer to the plan you're checking.
Returns
Returns true if the input plan is in the completed plan stack, false otherwise.

Definition at line 1159 of file Thread.cpp.

References GetPlans(), and lldb_private::ThreadPlanStack::IsPlanDone().

Referenced by lldb_private::Process::RunThreadPlan().

◆ IsValid()

bool lldb_private::Thread::IsValid ( ) const
inline

◆ JumpToLine()

Status Thread::JumpToLine ( const FileSpec file,
uint32_t  line,
bool  can_leave_function,
std::string *  warnings = nullptr 
)

◆ MatchesSpec()

bool Thread::MatchesSpec ( const ThreadSpec spec)
virtual

◆ operator=()

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

◆ PopPlan()

void Thread::PopPlan ( )
protected

◆ PushPlan()

void Thread::PushPlan ( lldb::ThreadPlanSP  plan_sp)
protected

◆ QueueBasePlan()

ThreadPlanSP Thread::QueueBasePlan ( bool  abort_other_plans)

Queues the base plan for a thread.

The version returned by Process does some things that are useful, like handle breakpoints and signals, so if you return a plugin specific one you probably want to call through to the Process one for anything your plugin doesn't explicitly handle.

Parameters
[in]abort_other_planstrue if we discard the currently queued plans and replace them with this one. Otherwise this plan will go on the end of the plan stack.
Returns
A shared pointer to the newly queued thread plan, or nullptr if the plan could not be queued.

Definition at line 1256 of file Thread.cpp.

References QueueThreadPlan().

◆ QueueThreadPlan()

Status Thread::QueueThreadPlan ( lldb::ThreadPlanSP plan_sp,
bool  abort_other_plans 
)

◆ QueueThreadPlanForRunToAddress()

ThreadPlanSP Thread::QueueThreadPlanForRunToAddress ( bool  abort_other_plans,
Address target_addr,
bool  stop_other_threads,
Status status 
)
virtual

Gets the plan used to continue from the current PC.

This is a simple plan, mostly useful as a backstop when you are continuing for some particular purpose.

Parameters
[in]abort_other_planstrue if we discard the currently queued plans and replace them with this one. Otherwise this plan will go on the end of the plan stack.
[in]target_addrThe address to which we're running.
[in]stop_other_threadstrue if we will stop other threads while we single step this one.
[out]statusA status with an error if queuing failed.
Returns
A shared pointer to the newly queued thread plan, or nullptr if the plan could not be queued.

Definition at line 1373 of file Thread.cpp.

References QueueThreadPlan().

Referenced by lldb::SBThread::RunToAddress(), and lldb_private::ThreadPlanStepInRange::ShouldStop().

◆ QueueThreadPlanForStepInRange() [1/2]

ThreadPlanSP Thread::QueueThreadPlanForStepInRange ( bool  abort_other_plans,
const AddressRange range,
const SymbolContext addr_context,
const char *  step_in_target,
lldb::RunMode  stop_other_threads,
Status status,
LazyBool  step_in_avoids_code_without_debug_info = eLazyBoolCalculate,
LazyBool  step_out_avoids_code_without_debug_info = eLazyBoolCalculate 
)
virtual

Queues the plan used to step through an address range, stepping into functions.

Parameters
[in]abort_other_planstrue if we discard the currently queued plans and replace them with this one. Otherwise this plan will go on the end of the plan stack.
[in]typeType of step to do, only eStepTypeInto and eStepTypeOver are supported by this plan.
[in]rangeThe address range to step through.
[in]addr_contextWhen dealing with stepping through inlined functions the current PC is not enough information to know what "step" means. For instance a series of nested inline functions might start at the same address. is supposed to be out of.
[in]step_in_targetName if function we are trying to step into. We will step out if we don't land in that function.
[in]stop_other_threadstrue if we will stop other threads while we single step this one.
[out]statusA status with an error if queuing failed.
[in]step_in_avoids_code_without_debug_infoIf eLazyBoolYes we will step out if we step into code with no debug info. If eLazyBoolCalculate we will consult the default set in the thread.
[in]step_out_avoids_code_without_debug_infoIf eLazyBoolYes, if the step over steps out it will continue to step out till it comes to a frame with debug info. If eLazyBoolCalculate, it will consult the default set in the thread.
Returns
A shared pointer to the newly queued thread plan, or nullptr if the plan could not be queued.

Definition at line 1298 of file Thread.cpp.

References QueueThreadPlan().

Referenced by lldb_private::ThreadPlanShouldStopHere::DefaultStepFromHereCallback(), CommandObjectThreadStepWithTypeAndScope::DoExecute(), QueueThreadPlanForStepInRange(), StepIn(), and lldb::SBThread::StepInto().

◆ QueueThreadPlanForStepInRange() [2/2]

ThreadPlanSP Thread::QueueThreadPlanForStepInRange ( bool  abort_other_plans,
const LineEntry line_entry,
const SymbolContext addr_context,
const char *  step_in_target,
lldb::RunMode  stop_other_threads,
Status status,
LazyBool  step_in_avoids_code_without_debug_info = eLazyBoolCalculate,
LazyBool  step_out_avoids_code_without_debug_info = eLazyBoolCalculate 
)
virtual

◆ QueueThreadPlanForStepOut()

ThreadPlanSP Thread::QueueThreadPlanForStepOut ( bool  abort_other_plans,
SymbolContext addr_context,
bool  first_insn,
bool  stop_other_threads,
Vote  report_stop_vote,
Vote  report_run_vote,
uint32_t  frame_idx,
Status status,
LazyBool  step_out_avoids_code_without_debug_info = eLazyBoolCalculate 
)
virtual

Queue the plan used to step out of the function at the current PC of thread.

Parameters
[in]abort_other_planstrue if we discard the currently queued plans and replace them with this one. Otherwise this plan will go on the end of the plan stack.
[in]addr_contextWhen dealing with stepping through inlined functions the current PC is not enough information to know what "step" means. For instance a series of nested inline functions might start at the same address. is supposed to be out of.
[in]first_insntrue if this is the first instruction of a function.
[in]stop_other_threadstrue if we will stop other threads while we single step this one.
[in]report_stop_voteSee standard meanings for the stop & run votes in ThreadPlan.h.
[in]report_run_voteSee standard meanings for the stop & run votes in ThreadPlan.h.
[out]statusA status with an error if queuing failed.
[in]step_out_avoids_code_without_debug_infoIf eLazyBoolYes, if the step over steps out it will continue to step out till it comes to a frame with debug info. If eLazyBoolCalculate, it will consult the default set in the thread.
Returns
A shared pointer to the newly queued thread plan, or nullptr if the plan could not be queued.

Definition at line 1328 of file Thread.cpp.

References QueueThreadPlan().

Referenced by lldb_private::ThreadPlanCallOnFunctionExit::DidPush(), CommandObjectThreadStepWithTypeAndScope::DoExecute(), lldb::SBThread::StepOut(), StepOut(), and lldb::SBThread::StepOutOfFrame().

◆ QueueThreadPlanForStepOutNoShouldStop()

ThreadPlanSP Thread::QueueThreadPlanForStepOutNoShouldStop ( bool  abort_other_plans,
SymbolContext addr_context,
bool  first_insn,
bool  stop_other_threads,
Vote  report_stop_vote,
Vote  report_run_vote,
uint32_t  frame_idx,
Status status,
bool  continue_to_next_branch = false 
)
virtual

Queue the plan used to step out of the function at the current PC of a thread.

This version does not consult the should stop here callback, and should only be used by other thread plans when they need to retain control of the step out.

Parameters
[in]abort_other_planstrue if we discard the currently queued plans and replace them with this one. Otherwise this plan will go on the end of the plan stack.
[in]addr_contextWhen dealing with stepping through inlined functions the current PC is not enough information to know what "step" means. For instance a series of nested inline functions might start at the same address. is supposed to be out of.
[in]first_insntrue if this is the first instruction of a function.
[in]stop_other_threadstrue if we will stop other threads while we single step this one.
[in]report_stop_voteSee standard meanings for the stop & run votes in ThreadPlan.h.
[in]report_run_voteSee standard meanings for the stop & run votes in ThreadPlan.h.
[in]frame_idxThe frame index.
[out]statusA status with an error if queuing failed.
[in]continue_to_next_branchNormally this will enqueue a plan that will put a breakpoint on the return address and continue to there. If continue_to_next_branch is true, this is an operation not involving the user – e.g. stepping "next" in a source line and we instruction stepped into another function – so instead of putting a breakpoint on the return address, advance the breakpoint to the end of the source line that is doing the call, or until the next flow control instruction. If the return value from the function call is to be retrieved / displayed to the user, you must stop on the return address. The return value may be stored in volatile registers which are overwritten before the next branch instruction.
Returns
A shared pointer to the newly queued thread plan, or nullptr if the plan could not be queued.

Definition at line 1341 of file Thread.cpp.

References lldb_private::ThreadPlanShouldStopHere::ClearShouldStopHereCallbacks(), lldb_private::eLazyBoolNo, and QueueThreadPlan().

Referenced by lldb_private::ThreadPlanShouldStopHere::DefaultStepFromHereCallback(), lldb_private::ThreadPlanStepInstruction::ShouldStop(), lldb_private::ThreadPlanStepOverRange::ShouldStop(), and lldb_private::AppleThreadPlanStepThroughObjCTrampoline::ShouldStop().

◆ QueueThreadPlanForStepOverRange() [1/2]

ThreadPlanSP Thread::QueueThreadPlanForStepOverRange ( bool  abort_other_plans,
const AddressRange range,
const SymbolContext addr_context,
lldb::RunMode  stop_other_threads,
Status status,
LazyBool  step_out_avoids_code_without_debug_info = eLazyBoolCalculate 
)
virtual

Queues the plan used to step through an address range, stepping over function calls.

Parameters
[in]abort_other_planstrue if we discard the currently queued plans and replace them with this one. Otherwise this plan will go on the end of the plan stack.
[in]typeType of step to do, only eStepTypeInto and eStepTypeOver are supported by this plan.
[in]rangeThe address range to step through.
[in]addr_contextWhen dealing with stepping through inlined functions the current PC is not enough information to know what "step" means. For instance a series of nested inline functions might start at the same address. is supposed to be out of.
[in]stop_other_threadstrue if we will stop other threads while we single step this one.
[out]statusA status with an error if queuing failed.
[in]step_out_avoids_code_without_debug_infoIf eLazyBoolYes, if the step over steps out it will continue to step out till it comes to a frame with debug info. If eLazyBoolCalculate, we will consult the default set in the thread.
Returns
A shared pointer to the newly queued thread plan, or nullptr if the plan could not be queued.

Definition at line 1271 of file Thread.cpp.

References QueueThreadPlan().

Referenced by CommandObjectThreadStepWithTypeAndScope::DoExecute(), QueueThreadPlanForStepOverRange(), lldb_private::ThreadPlanStepOverRange::ShouldStop(), StepOver(), and lldb::SBThread::StepOver().

◆ QueueThreadPlanForStepOverRange() [2/2]

ThreadPlanSP Thread::QueueThreadPlanForStepOverRange ( bool  abort_other_plans,
const LineEntry line_entry,
const SymbolContext addr_context,
lldb::RunMode  stop_other_threads,
Status status,
LazyBool  step_out_avoids_code_without_debug_info = eLazyBoolCalculate 
)
virtual

◆ QueueThreadPlanForStepScripted()

lldb::ThreadPlanSP Thread::QueueThreadPlanForStepScripted ( bool  abort_other_plans,
const char *  class_name,
StructuredData::ObjectSP  extra_args_sp,
bool  stop_other_threads,
Status status 
)
virtual

◆ QueueThreadPlanForStepSingleInstruction()

ThreadPlanSP Thread::QueueThreadPlanForStepSingleInstruction ( bool  step_over,
bool  abort_other_plans,
bool  stop_other_threads,
Status status 
)
virtual

Queues the plan used to step one instruction from the current PC of thread.

Parameters
[in]step_overtrue if we step over calls to functions, false if we step in.
[in]abort_other_planstrue if we discard the currently queued plans and replace them with this one. Otherwise this plan will go on the end of the plan stack.
[in]stop_other_threadstrue if we will stop other threads while we single step this one.
[out]statusA status with an error if queuing failed.
Returns
A shared pointer to the newly queued thread plan, or nullptr if the plan could not be queued.

Definition at line 1262 of file Thread.cpp.

References lldb_private::eVoteNoOpinion, and QueueThreadPlan().

Referenced by CommandObjectThreadStepWithTypeAndScope::DoExecute(), StepIn(), lldb::SBThread::StepInstruction(), lldb::SBThread::StepInto(), StepOver(), and lldb::SBThread::StepOver().

◆ QueueThreadPlanForStepThrough()

ThreadPlanSP Thread::QueueThreadPlanForStepThrough ( StackID return_stack_id,
bool  abort_other_plans,
bool  stop_other_threads,
Status status 
)
virtual

Gets the plan used to step through the code that steps from a function call site at the current PC into the actual function call.

Parameters
[in]return_stack_idThe stack id that we will return to (by setting backstop breakpoints on the return address to that frame) if we fail to step through.
[in]abort_other_planstrue if we discard the currently queued plans and replace them with this one. Otherwise this plan will go on the end of the plan stack.
[in]stop_other_threadstrue if we will stop other threads while we single step this one.
[out]statusA status with an error if queuing failed.
Returns
A shared pointer to the newly queued thread plan, or nullptr if the plan could not be queued.

Definition at line 1360 of file Thread.cpp.

References QueueThreadPlan().

Referenced by lldb_private::ThreadPlanStepInRange::ShouldStop(), and lldb_private::ThreadPlanStepOverRange::ShouldStop().

◆ QueueThreadPlanForStepUntil()

ThreadPlanSP Thread::QueueThreadPlanForStepUntil ( bool  abort_other_plans,
lldb::addr_t address_list,
size_t  num_addresses,
bool  stop_others,
uint32_t  frame_idx,
Status status 
)
virtual

Definition at line 1384 of file Thread.cpp.

References QueueThreadPlan().

Referenced by CommandObjectThreadUntil::DoExecute(), and lldb::SBThread::StepOverUntil().

◆ RefreshStateAfterStop()

virtual void lldb_private::Thread::RefreshStateAfterStop ( )
pure virtual

◆ ResetStopInfo()

void Thread::ResetStopInfo ( )

Definition at line 457 of file Thread.cpp.

References m_stop_info_sp.

Referenced by CalculatePublicStopInfo().

◆ RestoreRegisterStateFromCheckpoint()

bool Thread::RestoreRegisterStateFromCheckpoint ( ThreadStateCheckpoint saved_state)
virtual

◆ RestoreThreadStateFromCheckpoint()

void Thread::RestoreThreadStateFromCheckpoint ( ThreadStateCheckpoint saved_state)

◆ ReturnFromFrame()

Status Thread::ReturnFromFrame ( lldb::StackFrameSP  frame_sp,
lldb::ValueObjectSP  return_value_sp,
bool  broadcast = false 
)

◆ ReturnFromFrameWithIndex()

Status Thread::ReturnFromFrameWithIndex ( uint32_t  frame_idx,
lldb::ValueObjectSP  return_value_sp,
bool  broadcast = false 
)

◆ RunModeAsString()

std::string Thread::RunModeAsString ( lldb::RunMode  mode)
static

Definition at line 1748 of file Thread.cpp.

References lldb::eAllThreads, lldb::eOnlyDuringStepping, and lldb::eOnlyThisThread.

◆ SafeToCallFunctions()

bool Thread::SafeToCallFunctions ( )
virtual

Check whether this thread is safe to run functions.

The SystemRuntime may know of certain thread states (functions in process of execution, for instance) which can make it unsafe for functions to be called.

Returns
True if it is safe to call functions on this thread. False if function calls should be avoided on this thread.

Definition at line 1689 of file Thread.cpp.

References GetProcess(), lldb_private::Process::GetSystemRuntime(), lldb_private::DynamicLoader::IsFullyInitialized(), and lldb_private::SystemRuntime::SafeToCallFunctionsOnThisThread().

Referenced by lldb_private::AppleGetQueuesHandler::GetCurrentQueues(), lldb_private::AppleGetItemInfoHandler::GetItemInfo(), lldb_private::AppleGetPendingItemsHandler::GetPendingItems(), and lldb_private::AppleGetThreadItemInfoHandler::GetThreadItemInfo().

◆ SetAssociatedWithLibdispatchQueue()

virtual void lldb_private::Thread::SetAssociatedWithLibdispatchQueue ( lldb_private::LazyBool  associated_with_libdispatch_queue)
inlinevirtual

Reimplemented in lldb_private::process_gdb_remote::ThreadGDBRemote.

Definition at line 307 of file Thread.h.

◆ SetBackingThread()

virtual bool lldb_private::Thread::SetBackingThread ( const lldb::ThreadSP thread_sp)
inlinevirtual

Reimplemented in ThreadMemory.

Definition at line 470 of file Thread.h.

◆ SetDefaultFileAndLineToSelectedFrame()

void lldb_private::Thread::SetDefaultFileAndLineToSelectedFrame ( )
inline

Definition at line 459 of file Thread.h.

References GetStackFrameList().

◆ SetExtendedBacktraceToken()

virtual void lldb_private::Thread::SetExtendedBacktraceToken ( uint64_t  token)
inlinevirtual

Sets the extended backtrace token for this thread.

Some Thread subclasses may maintain a token to help with providing an extended backtrace. The SystemRuntime plugin will set/request this.

Parameters
[in]tokenThe extended backtrace token.

Reimplemented in lldb_private::HistoryThread.

Definition at line 1222 of file Thread.h.

◆ SetName()

virtual void lldb_private::Thread::SetName ( const char *  name)
inlinevirtual

◆ SetQueueID()

virtual void lldb_private::Thread::SetQueueID ( lldb::queue_id_t  new_val)
inlinevirtual

Reimplemented in lldb_private::HistoryThread.

Definition at line 325 of file Thread.h.

◆ SetQueueKind()

virtual void lldb_private::Thread::SetQueueKind ( lldb::QueueKind  kind)
inlinevirtual

Definition at line 351 of file Thread.h.

◆ SetQueueLibdispatchQueueAddress()

virtual void lldb_private::Thread::SetQueueLibdispatchQueueAddress ( lldb::addr_t  dispatch_queue_t)
inlinevirtual

Reimplemented in lldb_private::process_gdb_remote::ThreadGDBRemote.

Definition at line 381 of file Thread.h.

◆ SetQueueName()

virtual void lldb_private::Thread::SetQueueName ( const char *  name)
inlinevirtual

Reimplemented in lldb_private::HistoryThread.

Definition at line 337 of file Thread.h.

◆ SetResumeSignal()

void lldb_private::Thread::SetResumeSignal ( int  signal)
inline

Definition at line 161 of file Thread.h.

References m_resume_signal.

Referenced by DidResume().

◆ SetResumeState()

void lldb_private::Thread::SetResumeState ( lldb::StateType  state,
bool  override_suspend = false 
)
inline

Sets the USER resume state for this thread.

If you set a thread to suspended with this API, it won't take part in any of the arbitration for ShouldResume, and will stay suspended even when other threads do get to run.

N.B. This is not the state that is used internally by thread plans to implement staying on one thread while stepping over a breakpoint, etc. The is the TemporaryResume state, and if you are implementing some bit of strategy in the stepping machinery you should be using that state and not the user resume state.

If you are just preparing all threads to run, you should not override the threads that are marked as suspended by the debugger. In that case, pass override_suspend = false. If you want to force the thread to run (e.g. the "thread continue" command, or are resetting the state (e.g. in SBThread::Resume()), then pass true to override_suspend.

Definition at line 187 of file Thread.h.

References lldb::eStateSuspended, and m_resume_state.

Referenced by CommandObjectThreadContinue::DoExecute(), lldb::SBThread::Resume(), and lldb::SBThread::Suspend().

◆ SetSelectedFrame()

uint32_t Thread::SetSelectedFrame ( lldb_private::StackFrame frame,
bool  broadcast = false 
)

◆ SetSelectedFrameByIndex()

bool Thread::SetSelectedFrameByIndex ( uint32_t  frame_idx,
bool  broadcast = false 
)

◆ SetSelectedFrameByIndexNoisily()

bool Thread::SetSelectedFrameByIndexNoisily ( uint32_t  frame_idx,
Stream output_stream 
)

◆ SetShouldReportStop()

void Thread::SetShouldReportStop ( Vote  vote)

◆ SetShouldRunBeforePublicStop()

void lldb_private::Thread::SetShouldRunBeforePublicStop ( bool  newval)
inline

Definition at line 1208 of file Thread.h.

References m_should_run_before_public_stop.

Referenced by DidResume(), and ShouldStop().

◆ SetState()

void Thread::SetState ( lldb::StateType  state)

Definition at line 571 of file Thread.cpp.

References m_state, and m_state_mutex.

Referenced by DidStop(), and lldb_private::TargetThreadWindows::RefreshStateAfterStop().

◆ SetStopInfo()

void Thread::SetStopInfo ( const lldb::StopInfoSP stop_info_sp)

◆ SetStopInfoToNothing()

void Thread::SetStopInfoToNothing ( )

◆ SetTemporaryResumeState()

void lldb_private::Thread::SetTemporaryResumeState ( lldb::StateType  new_state)
inlineprotected

Definition at line 1293 of file Thread.h.

References m_temporary_resume_state.

Referenced by ShouldResume().

◆ SettingsInitialize()

void Thread::SettingsInitialize ( )
static

Definition at line 1667 of file Thread.cpp.

Referenced by lldb_private::Process::SettingsInitialize().

◆ SettingsTerminate()

void Thread::SettingsTerminate ( )
static

Definition at line 1669 of file Thread.cpp.

Referenced by lldb_private::Process::SettingsTerminate().

◆ SetupForResume()

void Thread::SetupForResume ( )

◆ ShouldReportRun()

Vote Thread::ShouldReportRun ( Event event_ptr)

◆ ShouldReportStop()

Vote Thread::ShouldReportStop ( Event event_ptr)

◆ ShouldResume()

bool Thread::ShouldResume ( lldb::StateType  resume_state)

◆ ShouldRunBeforePublicStop()

bool lldb_private::Thread::ShouldRunBeforePublicStop ( )
inline

Definition at line 1212 of file Thread.h.

References m_should_run_before_public_stop.

◆ ShouldStop()

bool Thread::ShouldStop ( Event event_ptr)

◆ StepIn()

Status Thread::StepIn ( bool  source_step,
LazyBool  step_in_avoids_code_without_debug_info = eLazyBoolCalculate,
LazyBool  step_out_avoids_code_without_debug_info = eLazyBoolCalculate 
)
virtual

Default implementation for stepping into.

This function is designed to be used by commands where the process is publicly stopped.

Parameters
[in]source_stepIf true and the frame has debug info, then do a source level step in, else do a single instruction step in.
[in]step_in_avoids_code_without_debug_infoIf true, then avoid stepping into code that doesn't have debug info, else step into any code regardless of whether it has debug info.
[in]step_out_avoids_code_without_debug_infoIf true, then if you step out to code with no debug info, keep stepping out till you get to code with debug info.
Returns
An error that describes anything that went wrong

Definition at line 1947 of file Thread.cpp.

References lldb::eOnlyThisThread, error(), lldb_private::Status::FromErrorString(), lldb_private::UserID::GetID(), GetProcess(), GetStackFrameAtIndex(), lldb_private::Process::GetState(), lldb_private::Process::GetThreadList(), lldb_private::SymbolContext::line_entry, QueueThreadPlanForStepInRange(), QueueThreadPlanForStepSingleInstruction(), lldb_private::Process::Resume(), lldb_private::ThreadList::SetSelectedThreadByID(), and lldb_private::StateIsStoppedState().

◆ StepOut()

Status Thread::StepOut ( uint32_t  frame_idx = 0)
virtual

Default implementation for stepping out.

This function is designed to be used by commands where the process is publicly stopped.

Parameters
[in]frame_idxThe frame index to step out of.
Returns
An error that describes anything that went wrong

Definition at line 2016 of file Thread.cpp.

References error(), lldb_private::eVoteNoOpinion, lldb_private::eVoteYes, lldb_private::Status::FromErrorString(), lldb_private::UserID::GetID(), GetProcess(), lldb_private::Process::GetState(), lldb_private::Process::GetThreadList(), QueueThreadPlanForStepOut(), lldb_private::Process::Resume(), lldb_private::ThreadList::SetSelectedThreadByID(), and lldb_private::StateIsStoppedState().

◆ StepOver()

Status Thread::StepOver ( bool  source_step,
LazyBool  step_out_avoids_code_without_debug_info = eLazyBoolCalculate 
)
virtual

Default implementation for stepping over.

This function is designed to be used by commands where the process is publicly stopped.

Parameters
[in]source_stepIf true and the frame has debug info, then do a source level step over, else do a single instruction step over.
Returns
An error that describes anything that went wrong

Definition at line 1983 of file Thread.cpp.

References lldb::eOnlyThisThread, error(), lldb_private::Status::FromErrorString(), lldb_private::UserID::GetID(), GetProcess(), GetStackFrameAtIndex(), lldb_private::Process::GetState(), lldb_private::Process::GetThreadList(), lldb_private::SymbolContext::line_entry, QueueThreadPlanForStepOverRange(), QueueThreadPlanForStepSingleInstruction(), lldb_private::Process::Resume(), lldb_private::ThreadList::SetSelectedThreadByID(), and lldb_private::StateIsStoppedState().

◆ StopInfoIsUpToDate()

bool Thread::StopInfoIsUpToDate ( ) const

Definition at line 448 of file Thread.cpp.

References GetProcess(), and m_stop_info_stop_id.

◆ StopReasonAsString()

std::string Thread::StopReasonAsString ( lldb::StopReason  reason)
static

◆ ThreadHasQueueInformation()

virtual bool lldb_private::Thread::ThreadHasQueueInformation ( ) const
inlinevirtual

Whether this Thread already has all the Queue information cached or not.

A Thread may be associated with a libdispatch work Queue at a given public stop event. If so, the thread can satisify requests like GetQueueLibdispatchQueueAddress, GetQueueKind, GetQueueName, and GetQueueID either from information from the remote debug stub when it is initially created, or it can query the SystemRuntime for that information.

This method allows the SystemRuntime to discover if a thread has this information already, instead of calling the thread to get the information and having the thread call the SystemRuntime again.

Reimplemented in lldb_private::process_gdb_remote::ThreadGDBRemote.

Definition at line 395 of file Thread.h.

◆ ThreadStoppedForAReason()

bool Thread::ThreadStoppedForAReason ( )

Definition at line 504 of file Thread.cpp.

References GetPrivateStopInfo().

Referenced by ShouldReportStop(), and ShouldStop().

◆ UnwindInnermostExpression()

Status Thread::UnwindInnermostExpression ( )

Unwinds the thread stack for the innermost expression plan currently on the thread plan stack.

Returns
An error if the thread plan could not be unwound.

Definition at line 1244 of file Thread.cpp.

References DiscardThreadPlansUpToPlan(), error(), lldb_private::Status::FromErrorString(), lldb_private::ThreadPlanStack::GetInnermostExpression(), and GetPlans().

Referenced by CommandObjectThreadReturn::DoExecute(), lldb_private::REPL::IOHandlerInputComplete(), and lldb::SBThread::UnwindInnermostExpression().

◆ WasThreadPlanDiscarded()

bool Thread::WasThreadPlanDiscarded ( ThreadPlan plan) const

Checks whether the given plan is in the discarded plans for this stop.

Parameters
[in]planPointer to the plan you're checking.
Returns
Returns true if the input plan is in the discarded plan stack, false otherwise.

Definition at line 1163 of file Thread.cpp.

References GetPlans(), and lldb_private::ThreadPlanStack::WasPlanDiscarded().

Referenced by lldb_private::Process::RunThreadPlan().

◆ WillResume()

virtual void lldb_private::Thread::WillResume ( lldb::StateType  resume_state)
inlinevirtual

◆ WillStop()

void Thread::WillStop ( )

Definition at line 608 of file Thread.cpp.

References GetCurrentPlan(), and lldb_private::ThreadPlan::WillStop().

Friends And Related Function Documentation

◆ OperatingSystem

friend class OperatingSystem
friend

Definition at line 1256 of file Thread.h.

◆ StackFrame

friend class StackFrame
friend

Definition at line 1255 of file Thread.h.

◆ StackFrameList

friend class StackFrameList
friend

Definition at line 1254 of file Thread.h.

◆ ThreadEventData

friend class ThreadEventData
friend

Definition at line 1253 of file Thread.h.

◆ ThreadList

friend class ThreadList
friend

Definition at line 1252 of file Thread.h.

◆ ThreadPlan

friend class ThreadPlan
friend

Definition at line 1251 of file Thread.h.

Member Data Documentation

◆ m_curr_frames_sp

lldb::StackFrameListSP lldb_private::Thread::m_curr_frames_sp
protected

The stack frames that get lazily populated after a thread stops.

Definition at line 1326 of file Thread.h.

Referenced by ClearStackFrames(), DestroyThread(), and GetStackFrameList().

◆ m_destroy_called

bool lldb_private::Thread::m_destroy_called
protected

Definition at line 1344 of file Thread.h.

Referenced by DestroyThread(), GetPrivateStopInfo(), GetStopInfo(), IsValid(), and ~Thread().

◆ m_extended_info

StructuredData::ObjectSP lldb_private::Thread::m_extended_info
private

Definition at line 1352 of file Thread.h.

Referenced by ClearStackFrames(), and GetExtendedInfo().

◆ m_extended_info_fetched

bool lldb_private::Thread::m_extended_info_fetched
private

Definition at line 1350 of file Thread.h.

Referenced by ClearStackFrames(), and GetExtendedInfo().

◆ m_frame_mutex

std::recursive_mutex lldb_private::Thread::m_frame_mutex
mutableprotected

Multithreaded protection for m_state.

Definition at line 1325 of file Thread.h.

Referenced by ClearStackFrames(), DestroyThread(), and GetStackFrameList().

◆ m_index_id

const uint32_t lldb_private::Thread::m_index_id
protected

A unique 1 based index assigned to each thread for easy UI/command line access.

Definition at line 1317 of file Thread.h.

Referenced by GetIndexID().

◆ m_null_plan_stack_up

std::unique_ptr<ThreadPlanStack> lldb_private::Thread::m_null_plan_stack_up
mutableprotected

Definition at line 1347 of file Thread.h.

Referenced by GetPlans().

◆ m_override_should_notify

LazyBool lldb_private::Thread::m_override_should_notify
protected

Definition at line 1346 of file Thread.h.

Referenced by SetShouldReportStop(), SetStopInfo(), and ShouldResume().

◆ m_prev_frames_sp

lldb::StackFrameListSP lldb_private::Thread::m_prev_frames_sp
protected

The previous stack frames from the last time this thread stopped.

Definition at line 1328 of file Thread.h.

Referenced by ClearStackFrames(), DestroyThread(), and GetStackFrameList().

◆ m_prev_framezero_pc

std::optional<lldb::addr_t> lldb_private::Thread::m_prev_framezero_pc
protected

Frame 0's PC the last time this thread was stopped.

Definition at line 1331 of file Thread.h.

Referenced by ClearStackFrames(), DestroyThread(), and GetPreviousFrameZeroPC().

◆ m_process_wp

lldb::ProcessWP lldb_private::Thread::m_process_wp
protected

The process that owns this thread.

Definition at line 1305 of file Thread.h.

Referenced by GetProcess().

◆ m_reg_context_sp

lldb::RegisterContextSP lldb_private::Thread::m_reg_context_sp
protected

◆ m_resume_signal

int lldb_private::Thread::m_resume_signal
protected

The signal that should be used when continuing this thread.

Definition at line 1333 of file Thread.h.

Referenced by GetResumeSignal(), and SetResumeSignal().

◆ m_resume_state

lldb::StateType lldb_private::Thread::m_resume_state
protected

This state is used to force a thread to be suspended from outside the ThreadPlan logic.

Definition at line 1335 of file Thread.h.

Referenced by GetResumeState(), and SetResumeState().

◆ m_should_run_before_public_stop

bool lldb_private::Thread::m_should_run_before_public_stop
protected

Definition at line 1314 of file Thread.h.

Referenced by SetShouldRunBeforePublicStop(), and ShouldRunBeforePublicStop().

◆ m_state

lldb::StateType lldb_private::Thread::m_state
protected

The state of our process.

Definition at line 1321 of file Thread.h.

Referenced by GetState(), and SetState().

◆ m_state_mutex

std::recursive_mutex lldb_private::Thread::m_state_mutex
mutableprotected

Multithreaded protection for m_state.

Definition at line 1323 of file Thread.h.

Referenced by GetState(), and SetState().

◆ m_stop_info_override_stop_id

uint32_t lldb_private::Thread::m_stop_info_override_stop_id
protected

Definition at line 1311 of file Thread.h.

Referenced by GetPrivateStopInfo().

◆ m_stop_info_sp

lldb::StopInfoSP lldb_private::Thread::m_stop_info_sp
protected

◆ m_stop_info_stop_id

uint32_t lldb_private::Thread::m_stop_info_stop_id
protected

◆ m_temporary_resume_state

lldb::StateType lldb_private::Thread::m_temporary_resume_state
protected

This state records what the thread was told to do by the thread plan logic for the current resume.

Definition at line 1338 of file Thread.h.

Referenced by GetTemporaryResumeState(), and SetTemporaryResumeState().

◆ m_unwinder_up

std::unique_ptr<lldb_private::Unwind> lldb_private::Thread::m_unwinder_up
protected

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