LLDB mainline
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
lldb_private::process_gdb_remote::ThreadGDBRemote Class Reference

#include <ThreadGDBRemote.h>

Inheritance diagram for lldb_private::process_gdb_remote::ThreadGDBRemote:
Inheritance graph
[legend]

Public Member Functions

 ThreadGDBRemote (Process &process, lldb::tid_t tid)
 
 ~ThreadGDBRemote () override
 
void WillResume (lldb::StateType resume_state) override
 
void RefreshStateAfterStop () override
 
const char * GetName () override
 
const char * GetQueueName () override
 Retrieve the Queue name for the queue currently using this Thread.
 
lldb::QueueKind GetQueueKind () override
 Retrieve the Queue kind for the queue currently using this Thread.
 
lldb::queue_id_t GetQueueID () override
 Retrieve the Queue ID for the queue currently using this Thread.
 
lldb::QueueSP GetQueue () override
 Retrieve the Queue for this thread, if any.
 
lldb::addr_t GetQueueLibdispatchQueueAddress () override
 Retrieve the address of the libdispatch_queue_t struct for queue currently using this Thread.
 
void SetQueueLibdispatchQueueAddress (lldb::addr_t dispatch_queue_t) override
 
bool ThreadHasQueueInformation () const override
 Whether this Thread already has all the Queue information cached or not.
 
lldb::RegisterContextSP GetRegisterContext () override
 
lldb::RegisterContextSP CreateRegisterContextForFrame (StackFrame *frame) override
 
void Dump (Log *log, uint32_t index)
 
bool ShouldStop (bool &step_more)
 
const char * GetBasicInfoAsString ()
 
void SetName (const char *name) override
 
lldb::addr_t GetThreadDispatchQAddr ()
 
void SetThreadDispatchQAddr (lldb::addr_t thread_dispatch_qaddr)
 
void ClearQueueInfo ()
 
void SetQueueInfo (std::string &&queue_name, lldb::QueueKind queue_kind, uint64_t queue_serial, lldb::addr_t dispatch_queue_t, lldb_private::LazyBool associated_with_libdispatch_queue)
 
lldb_private::LazyBool GetAssociatedWithLibdispatchQueue () override
 Whether this thread can be associated with a libdispatch queue.
 
void SetAssociatedWithLibdispatchQueue (lldb_private::LazyBool associated_with_libdispatch_queue) override
 
StructuredData::ObjectSP FetchThreadExtendedInfo () override
 
- Public Member Functions inherited from lldb_private::Thread
ConstStringGetBroadcasterClass () 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 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 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
 
- 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 ConstStringGetBroadcasterClass () 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 bool ThreadIDIsValid (lldb::tid_t thread)
 
- Static Public Member Functions inherited from lldb_private::Thread
static ConstStringGetStaticBroadcasterClass ()
 
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

bool PrivateSetRegisterValue (uint32_t reg, llvm::ArrayRef< uint8_t > data)
 
bool PrivateSetRegisterValue (uint32_t reg, uint64_t regval)
 
bool CachedQueueInfoIsValid () const
 
void SetStopInfoFromPacket (StringExtractor &stop_packet, uint32_t stop_id)
 
bool CalculateStopInfo () override
 Ask the thread subclass to set its stop info.
 
llvm::Expected< std::unique_ptr< llvm::MemoryBuffer > > GetSiginfo (size_t max_size) const override
 
- Protected Member Functions inherited from lldb_private::Thread
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

std::string m_thread_name
 
std::string m_dispatch_queue_name
 
lldb::addr_t m_thread_dispatch_qaddr
 
lldb::addr_t m_dispatch_queue_t
 
lldb::QueueKind m_queue_kind
 
uint64_t m_queue_serial_number
 
lldb_private::LazyBool m_associated_with_libdispatch_queue
 
GDBRemoteDynamicRegisterInfoSP m_reg_info_sp
 
- Protected Attributes inherited from lldb_private::Thread
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.
 

Friends

class ProcessGDBRemote
 

Additional Inherited Members

- Public Types inherited from lldb_private::Thread
enum  {
  eBroadcastBitStackChanged = (1 << 0) , eBroadcastBitThreadSuspended = (1 << 1) , eBroadcastBitThreadResumed = (1 << 2) , eBroadcastBitSelectedFrameChanged = (1 << 3) ,
  eBroadcastBitThreadSelected = (1 << 4)
}
 Broadcaster event bits definitions. More...
 
- Protected Types inherited from lldb_private::Broadcaster
typedef std::shared_ptr< BroadcasterImplBroadcasterImplSP
 
typedef std::weak_ptr< BroadcasterImplBroadcasterImplWP
 

Detailed Description

Definition at line 28 of file ThreadGDBRemote.h.

Constructor & Destructor Documentation

◆ ThreadGDBRemote()

ThreadGDBRemote::ThreadGDBRemote ( Process process,
lldb::tid_t  tid 
)

◆ ~ThreadGDBRemote()

ThreadGDBRemote::~ThreadGDBRemote ( )
override

Member Function Documentation

◆ CachedQueueInfoIsValid()

bool lldb_private::process_gdb_remote::ThreadGDBRemote::CachedQueueInfoIsValid ( ) const
inlineprotected

Definition at line 112 of file ThreadGDBRemote.h.

References lldb::eQueueKindUnknown, and m_queue_kind.

Referenced by GetQueueID(), GetQueueKind(), and GetQueueName().

◆ CalculateStopInfo()

bool ThreadGDBRemote::CalculateStopInfo ( )
overrideprotectedvirtual

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.

Implements lldb_private::Thread.

Definition at line 342 of file ThreadGDBRemote.cpp.

References lldb_private::Thread::GetProcess().

◆ ClearQueueInfo()

void ThreadGDBRemote::ClearQueueInfo ( )

◆ CreateRegisterContextForFrame()

lldb::RegisterContextSP ThreadGDBRemote::CreateRegisterContextForFrame ( StackFrame frame)
overridevirtual

◆ Dump()

void ThreadGDBRemote::Dump ( Log log,
uint32_t  index 
)

Definition at line 290 of file ThreadGDBRemote.cpp.

◆ FetchThreadExtendedInfo()

StructuredData::ObjectSP ThreadGDBRemote::FetchThreadExtendedInfo ( )
overridevirtual

◆ GetAssociatedWithLibdispatchQueue()

LazyBool ThreadGDBRemote::GetAssociatedWithLibdispatchQueue ( )
overridevirtual

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 from lldb_private::Thread.

Definition at line 213 of file ThreadGDBRemote.cpp.

References m_associated_with_libdispatch_queue.

◆ GetBasicInfoAsString()

const char * lldb_private::process_gdb_remote::ThreadGDBRemote::GetBasicInfoAsString ( )

◆ GetName()

const char * ThreadGDBRemote::GetName ( )
overridevirtual

Reimplemented from lldb_private::Thread.

Definition at line 63 of file ThreadGDBRemote.cpp.

References m_thread_name.

◆ GetQueue()

QueueSP ThreadGDBRemote::GetQueue ( )
overridevirtual

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 from lldb_private::Thread.

Definition at line 171 of file ThreadGDBRemote.cpp.

References lldb_private::Thread::GetProcess(), GetQueueID(), and LLDB_INVALID_QUEUE_ID.

◆ GetQueueID()

queue_id_t ThreadGDBRemote::GetQueueID ( )
overridevirtual

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 from lldb_private::Thread.

Definition at line 147 of file ThreadGDBRemote.cpp.

References CachedQueueInfoIsValid(), lldb_private::eLazyBoolNo, lldb_private::Thread::GetProcess(), lldb_private::SystemRuntime::GetQueueIDFromThreadQAddress(), LLDB_INVALID_ADDRESS, LLDB_INVALID_QUEUE_ID, m_associated_with_libdispatch_queue, m_queue_serial_number, and m_thread_dispatch_qaddr.

Referenced by GetQueue().

◆ GetQueueKind()

QueueKind ThreadGDBRemote::GetQueueKind ( )
overridevirtual

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 from lldb_private::Thread.

Definition at line 122 of file ThreadGDBRemote.cpp.

References CachedQueueInfoIsValid(), lldb_private::eLazyBoolNo, lldb::eQueueKindUnknown, lldb_private::Thread::GetProcess(), lldb_private::SystemRuntime::GetQueueKind(), LLDB_INVALID_ADDRESS, m_associated_with_libdispatch_queue, m_queue_kind, and m_thread_dispatch_qaddr.

◆ GetQueueLibdispatchQueueAddress()

addr_t ThreadGDBRemote::GetQueueLibdispatchQueueAddress ( )
overridevirtual

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 from lldb_private::Thread.

Definition at line 183 of file ThreadGDBRemote.cpp.

References lldb_private::SystemRuntime::GetLibdispatchQueueAddressFromThreadQAddress(), lldb_private::Thread::GetProcess(), LLDB_INVALID_ADDRESS, m_dispatch_queue_t, and m_thread_dispatch_qaddr.

◆ GetQueueName()

const char * ThreadGDBRemote::GetQueueName ( )
overridevirtual

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 from lldb_private::Thread.

Definition at line 88 of file ThreadGDBRemote.cpp.

References CachedQueueInfoIsValid(), lldb_private::eLazyBoolNo, lldb_private::Thread::GetProcess(), lldb_private::SystemRuntime::GetQueueNameFromThreadQAddress(), LLDB_INVALID_ADDRESS, m_associated_with_libdispatch_queue, m_dispatch_queue_name, and m_thread_dispatch_qaddr.

◆ GetRegisterContext()

lldb::RegisterContextSP ThreadGDBRemote::GetRegisterContext ( )
overridevirtual

◆ GetSiginfo()

llvm::Expected< std::unique_ptr< llvm::MemoryBuffer > > ThreadGDBRemote::GetSiginfo ( size_t  max_size) const
overrideprotectedvirtual

◆ GetThreadDispatchQAddr()

lldb::addr_t lldb_private::process_gdb_remote::ThreadGDBRemote::GetThreadDispatchQAddr ( )
inline

Definition at line 74 of file ThreadGDBRemote.h.

References m_thread_dispatch_qaddr.

◆ PrivateSetRegisterValue() [1/2]

bool ThreadGDBRemote::PrivateSetRegisterValue ( uint32_t  reg,
llvm::ArrayRef< uint8_t >  data 
)
protected

◆ PrivateSetRegisterValue() [2/2]

bool ThreadGDBRemote::PrivateSetRegisterValue ( uint32_t  reg,
uint64_t  regval 
)
protected

◆ RefreshStateAfterStop()

void ThreadGDBRemote::RefreshStateAfterStop ( )
overridevirtual

Implements lldb_private::Thread.

Definition at line 273 of file ThreadGDBRemote.cpp.

References GetRegisterContext().

◆ SetAssociatedWithLibdispatchQueue()

void ThreadGDBRemote::SetAssociatedWithLibdispatchQueue ( lldb_private::LazyBool  associated_with_libdispatch_queue)
overridevirtual

◆ SetName()

void lldb_private::process_gdb_remote::ThreadGDBRemote::SetName ( const char *  name)
inlineoverridevirtual

Reimplemented from lldb_private::Thread.

Definition at line 67 of file ThreadGDBRemote.h.

References m_thread_name.

◆ SetQueueInfo()

void ThreadGDBRemote::SetQueueInfo ( std::string &&  queue_name,
lldb::QueueKind  queue_kind,
uint64_t  queue_serial,
lldb::addr_t  dispatch_queue_t,
lldb_private::LazyBool  associated_with_libdispatch_queue 
)

◆ SetQueueLibdispatchQueueAddress()

void ThreadGDBRemote::SetQueueLibdispatchQueueAddress ( lldb::addr_t  dispatch_queue_t)
overridevirtual

◆ SetStopInfoFromPacket()

void lldb_private::process_gdb_remote::ThreadGDBRemote::SetStopInfoFromPacket ( StringExtractor stop_packet,
uint32_t  stop_id 
)
protected

◆ SetThreadDispatchQAddr()

void lldb_private::process_gdb_remote::ThreadGDBRemote::SetThreadDispatchQAddr ( lldb::addr_t  thread_dispatch_qaddr)
inline

◆ ShouldStop()

bool ThreadGDBRemote::ShouldStop ( bool &  step_more)

Definition at line 292 of file ThreadGDBRemote.cpp.

◆ ThreadHasQueueInformation()

bool ThreadGDBRemote::ThreadHasQueueInformation ( ) const
overridevirtual

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 from lldb_private::Thread.

Definition at line 206 of file ThreadGDBRemote.cpp.

References lldb::eQueueKindUnknown, LLDB_INVALID_ADDRESS, m_dispatch_queue_t, m_queue_kind, m_queue_serial_number, and m_thread_dispatch_qaddr.

◆ ThreadIDIsValid()

bool ThreadGDBRemote::ThreadIDIsValid ( lldb::tid_t  thread)
static

Definition at line 286 of file ThreadGDBRemote.cpp.

◆ WillResume()

void ThreadGDBRemote::WillResume ( lldb::StateType  resume_state)
overridevirtual

Friends And Related Function Documentation

◆ ProcessGDBRemote

friend class ProcessGDBRemote
friend

Definition at line 94 of file ThreadGDBRemote.h.

Member Data Documentation

◆ m_associated_with_libdispatch_queue

lldb_private::LazyBool lldb_private::process_gdb_remote::ThreadGDBRemote::m_associated_with_libdispatch_queue
protected

◆ m_dispatch_queue_name

std::string lldb_private::process_gdb_remote::ThreadGDBRemote::m_dispatch_queue_name
protected

Definition at line 97 of file ThreadGDBRemote.h.

Referenced by ClearQueueInfo(), GetQueueName(), and SetQueueInfo().

◆ m_dispatch_queue_t

lldb::addr_t lldb_private::process_gdb_remote::ThreadGDBRemote::m_dispatch_queue_t
protected

◆ m_queue_kind

lldb::QueueKind lldb_private::process_gdb_remote::ThreadGDBRemote::m_queue_kind
protected

◆ m_queue_serial_number

uint64_t lldb_private::process_gdb_remote::ThreadGDBRemote::m_queue_serial_number
protected

◆ m_reg_info_sp

GDBRemoteDynamicRegisterInfoSP lldb_private::process_gdb_remote::ThreadGDBRemote::m_reg_info_sp
protected

Definition at line 106 of file ThreadGDBRemote.h.

Referenced by CreateRegisterContextForFrame(), and ThreadGDBRemote().

◆ m_thread_dispatch_qaddr

lldb::addr_t lldb_private::process_gdb_remote::ThreadGDBRemote::m_thread_dispatch_qaddr
protected

◆ m_thread_name

std::string lldb_private::process_gdb_remote::ThreadGDBRemote::m_thread_name
protected

Definition at line 96 of file ThreadGDBRemote.h.

Referenced by GetName(), and SetName().


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