LLDB  mainline
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
lldb::SBThread Class Reference

#include <SBThread.h>

Public Types

enum  {
  eBroadcastBitStackChanged = (1 << 0), eBroadcastBitThreadSuspended = (1 << 1), eBroadcastBitThreadResumed = (1 << 2), eBroadcastBitSelectedFrameChanged = (1 << 3),
  eBroadcastBitThreadSelected = (1 << 4)
}
 

Public Member Functions

 SBThread ()
 
 SBThread (const lldb::SBThread &thread)
 
 SBThread (const lldb::ThreadSP &lldb_object_sp)
 
 ~SBThread ()
 
lldb::SBQueue GetQueue () const
 
 operator bool () const
 
bool IsValid () const
 
void Clear ()
 
lldb::StopReason GetStopReason ()
 
size_t GetStopReasonDataCount ()
 Get the number of words associated with the stop reason. More...
 
uint64_t GetStopReasonDataAtIndex (uint32_t idx)
 Get information associated with a stop reason. More...
 
bool GetStopReasonExtendedInfoAsJSON (lldb::SBStream &stream)
 
SBThreadCollection GetStopReasonExtendedBacktraces (InstrumentationRuntimeType type)
 
size_t GetStopDescription (char *dst, size_t dst_len)
 
SBValue GetStopReturnValue ()
 
lldb::tid_t GetThreadID () const
 
uint32_t GetIndexID () const
 
const char * GetName () const
 
const char * GetQueueName () const
 
lldb::queue_id_t GetQueueID () const
 
bool GetInfoItemByPathAsString (const char *path, SBStream &strm)
 
void StepOver (lldb::RunMode stop_other_threads=lldb::eOnlyDuringStepping)
 
void StepOver (lldb::RunMode stop_other_threads, SBError &error)
 
void StepInto (lldb::RunMode stop_other_threads=lldb::eOnlyDuringStepping)
 
void StepInto (const char *target_name, lldb::RunMode stop_other_threads=lldb::eOnlyDuringStepping)
 
void StepInto (const char *target_name, uint32_t end_line, SBError &error, lldb::RunMode stop_other_threads=lldb::eOnlyDuringStepping)
 
void StepOut ()
 
void StepOut (SBError &error)
 
void StepOutOfFrame (SBFrame &frame)
 
void StepOutOfFrame (SBFrame &frame, SBError &error)
 
void StepInstruction (bool step_over)
 
void StepInstruction (bool step_over, SBError &error)
 
SBError StepOverUntil (lldb::SBFrame &frame, lldb::SBFileSpec &file_spec, uint32_t line)
 
SBError StepUsingScriptedThreadPlan (const char *script_class_name)
 
SBError StepUsingScriptedThreadPlan (const char *script_class_name, bool resume_immediately)
 
SBError JumpToLine (lldb::SBFileSpec &file_spec, uint32_t line)
 
void RunToAddress (lldb::addr_t addr)
 
void RunToAddress (lldb::addr_t addr, SBError &error)
 
SBError ReturnFromFrame (SBFrame &frame, SBValue &return_value)
 
SBError UnwindInnermostExpression ()
 
bool Suspend ()
 LLDB currently supports process centric debugging which means when any thread in a process stops, all other threads are stopped. More...
 
bool Suspend (SBError &error)
 
bool Resume ()
 
bool Resume (SBError &error)
 
bool IsSuspended ()
 
bool IsStopped ()
 
uint32_t GetNumFrames ()
 
lldb::SBFrame GetFrameAtIndex (uint32_t idx)
 
lldb::SBFrame GetSelectedFrame ()
 
lldb::SBFrame SetSelectedFrame (uint32_t frame_idx)
 
lldb::SBProcess GetProcess ()
 
const lldb::SBThreadoperator= (const lldb::SBThread &rhs)
 
bool operator== (const lldb::SBThread &rhs) const
 
bool operator!= (const lldb::SBThread &rhs) const
 
bool GetDescription (lldb::SBStream &description) const
 
bool GetDescription (lldb::SBStream &description, bool stop_format) const
 
bool GetStatus (lldb::SBStream &status) const
 
SBThread GetExtendedBacktraceThread (const char *type)
 
uint32_t GetExtendedBacktraceOriginatingIndexID ()
 
SBValue GetCurrentException ()
 
SBThread GetCurrentExceptionBacktrace ()
 
bool SafeToCallFunctions ()
 

Static Public Member Functions

static const char * GetBroadcasterClassName ()
 
static bool EventIsThreadEvent (const SBEvent &event)
 
static SBFrame GetStackFrameFromEvent (const SBEvent &event)
 
static SBThread GetThreadFromEvent (const SBEvent &event)
 

Friends

class SBBreakpoint
 
class SBBreakpointLocation
 
class SBBreakpointCallbackBaton
 
class SBExecutionContext
 
class SBFrame
 
class SBProcess
 
class SBDebugger
 
class SBValue
 
class lldb_private::QueueImpl
 
class SBQueueItem
 
class SBThreadPlan
 

Detailed Description

Definition at line 20 of file SBThread.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
eBroadcastBitStackChanged 
eBroadcastBitThreadSuspended 
eBroadcastBitThreadResumed 
eBroadcastBitSelectedFrameChanged 
eBroadcastBitThreadSelected 

Definition at line 22 of file SBThread.h.

Constructor & Destructor Documentation

◆ SBThread() [1/3]

SBThread::SBThread ( )

Definition at line 60 of file SBThread.cpp.

References LLDB_RECORD_CONSTRUCTOR, and LLDB_RECORD_CONSTRUCTOR_NO_ARGS.

Referenced by GetCurrentExceptionBacktrace().

◆ SBThread() [2/3]

SBThread::SBThread ( const lldb::SBThread thread)

Definition at line 69 of file SBThread.cpp.

References lldb_private::clone(), and LLDB_RECORD_CONSTRUCTOR.

◆ SBThread() [3/3]

lldb::SBThread::SBThread ( const lldb::ThreadSP &  lldb_object_sp)

◆ ~SBThread()

SBThread::~SBThread ( )

Definition at line 87 of file SBThread.cpp.

Member Function Documentation

◆ Clear()

void SBThread::Clear ( )

◆ EventIsThreadEvent()

bool SBThread::EventIsThreadEvent ( const SBEvent event)
static

◆ GetBroadcasterClassName()

const char * SBThread::GetBroadcasterClassName ( )
static

◆ GetCurrentException()

SBValue SBThread::GetCurrentException ( )

◆ GetCurrentExceptionBacktrace()

SBThread SBThread::GetCurrentExceptionBacktrace ( )

◆ GetDescription() [1/2]

bool SBThread::GetDescription ( lldb::SBStream description) const

◆ GetDescription() [2/2]

bool SBThread::GetDescription ( lldb::SBStream description,
bool  stop_format 
) const

◆ GetExtendedBacktraceOriginatingIndexID()

uint32_t SBThread::GetExtendedBacktraceOriginatingIndexID ( )

◆ GetExtendedBacktraceThread()

SBThread SBThread::GetExtendedBacktraceThread ( const char *  type)

◆ GetFrameAtIndex()

SBFrame SBThread::GetFrameAtIndex ( uint32_t  idx)

◆ GetIndexID()

uint32_t SBThread::GetIndexID ( ) const

◆ GetInfoItemByPathAsString()

bool SBThread::GetInfoItemByPathAsString ( const char *  path,
SBStream strm 
)

◆ GetName()

const char * SBThread::GetName ( ) const

◆ GetNumFrames()

uint32_t SBThread::GetNumFrames ( )

◆ GetProcess()

SBProcess SBThread::GetProcess ( )

◆ GetQueue()

lldb::SBQueue SBThread::GetQueue ( ) const

◆ GetQueueID()

lldb::queue_id_t SBThread::GetQueueID ( ) const

◆ GetQueueName()

const char * SBThread::GetQueueName ( ) const

◆ GetSelectedFrame()

lldb::SBFrame SBThread::GetSelectedFrame ( )

◆ GetStackFrameFromEvent()

SBFrame SBThread::GetStackFrameFromEvent ( const SBEvent event)
static

◆ GetStatus()

bool SBThread::GetStatus ( lldb::SBStream status) const

◆ GetStopDescription()

size_t SBThread::GetStopDescription ( char *  dst,
size_t  dst_len 
)

◆ GetStopReason()

StopReason SBThread::GetStopReason ( )

◆ GetStopReasonDataAtIndex()

uint64_t SBThread::GetStopReasonDataAtIndex ( uint32_t  idx)

Get information associated with a stop reason.

Breakpoint stop reasons will have data that consists of pairs of breakpoint IDs followed by the breakpoint location IDs (they always come in pairs).

Stop Reason Count Data Type ======================== ===== ========================================= eStopReasonNone 0 eStopReasonTrace 0 eStopReasonBreakpoint N duple: {breakpoint id, location id} eStopReasonWatchpoint 1 watchpoint id eStopReasonSignal 1 unix signal number eStopReasonException N exception data eStopReasonExec 0 eStopReasonPlanComplete 0

Definition at line 203 of file SBThread.cpp.

References lldb::eStopReasonBreakpoint, lldb::eStopReasonException, lldb::eStopReasonExec, lldb::eStopReasonInstrumentation, lldb::eStopReasonInvalid, lldb::eStopReasonNone, lldb::eStopReasonPlanComplete, lldb::eStopReasonSignal, lldb::eStopReasonThreadExiting, lldb::eStopReasonTrace, lldb::eStopReasonWatchpoint, lldb_private::Thread::GetStopInfo(), LLDB_INVALID_BREAK_ID, LLDB_RECORD_METHOD, and lldb_private::ProcessRunLock::ProcessRunLocker::TryLock().

Referenced by lldb_private::repro::RegisterMethods< SBThread >().

◆ GetStopReasonDataCount()

size_t SBThread::GetStopReasonDataCount ( )

◆ GetStopReasonExtendedBacktraces()

SBThreadCollection SBThread::GetStopReasonExtendedBacktraces ( InstrumentationRuntimeType  type)

◆ GetStopReasonExtendedInfoAsJSON()

bool SBThread::GetStopReasonExtendedInfoAsJSON ( lldb::SBStream stream)

◆ GetStopReturnValue()

SBValue SBThread::GetStopReturnValue ( )

◆ GetThreadFromEvent()

SBThread SBThread::GetThreadFromEvent ( const SBEvent event)
static

◆ GetThreadID()

lldb::tid_t SBThread::GetThreadID ( ) const

◆ IsStopped()

bool SBThread::IsStopped ( )

◆ IsSuspended()

bool SBThread::IsSuspended ( )

◆ IsValid()

bool SBThread::IsValid ( ) const

◆ JumpToLine()

SBError SBThread::JumpToLine ( lldb::SBFileSpec file_spec,
uint32_t  line 
)

◆ operator bool()

SBThread::operator bool ( ) const
explicit

◆ operator!=()

bool SBThread::operator!= ( const lldb::SBThread rhs) const

Definition at line 1265 of file SBThread.cpp.

References LLDB_RECORD_METHOD_CONST.

◆ operator=()

const lldb::SBThread & SBThread::operator= ( const lldb::SBThread rhs)

Definition at line 77 of file SBThread.cpp.

References lldb_private::clone(), LLDB_RECORD_METHOD, and LLDB_RECORD_RESULT.

◆ operator==()

bool SBThread::operator== ( const lldb::SBThread rhs) const

Definition at line 1257 of file SBThread.cpp.

References LLDB_RECORD_METHOD_CONST.

◆ Resume() [1/2]

bool SBThread::Resume ( )

◆ Resume() [2/2]

bool SBThread::Resume ( SBError error)

◆ ReturnFromFrame()

SBError SBThread::ReturnFromFrame ( SBFrame frame,
SBValue return_value 
)

◆ RunToAddress() [1/2]

void SBThread::RunToAddress ( lldb::addr_t  addr)

Definition at line 805 of file SBThread.cpp.

References LLDB_RECORD_METHOD.

Referenced by lldb_private::repro::RegisterMethods< SBThread >(), and RunToAddress().

◆ RunToAddress() [2/2]

void SBThread::RunToAddress ( lldb::addr_t  addr,
SBError error 
)

◆ SafeToCallFunctions()

bool SBThread::SafeToCallFunctions ( )

◆ SetSelectedFrame()

lldb::SBFrame SBThread::SetSelectedFrame ( uint32_t  frame_idx)

◆ StepInstruction() [1/2]

void SBThread::StepInstruction ( bool  step_over)

◆ StepInstruction() [2/2]

void SBThread::StepInstruction ( bool  step_over,
SBError error 
)

◆ StepInto() [1/3]

void SBThread::StepInto ( lldb::RunMode  stop_other_threads = lldb::eOnlyDuringStepping)

Definition at line 626 of file SBThread.cpp.

References LLDB_RECORD_METHOD.

Referenced by lldb_private::repro::RegisterMethods< SBThread >(), and StepInto().

◆ StepInto() [2/3]

void SBThread::StepInto ( const char *  target_name,
lldb::RunMode  stop_other_threads = lldb::eOnlyDuringStepping 
)

Definition at line 633 of file SBThread.cpp.

References LLDB_INVALID_LINE_NUMBER, LLDB_RECORD_METHOD, and StepInto().

◆ StepInto() [3/3]

void SBThread::StepInto ( const char *  target_name,
uint32_t  end_line,
SBError error,
lldb::RunMode  stop_other_threads = lldb::eOnlyDuringStepping 
)

◆ StepOut() [1/2]

void SBThread::StepOut ( )

◆ StepOut() [2/2]

void SBThread::StepOut ( SBError error)

◆ StepOutOfFrame() [1/2]

void SBThread::StepOutOfFrame ( SBFrame frame)

Definition at line 728 of file SBThread.cpp.

References LLDB_RECORD_METHOD.

Referenced by lldb_private::repro::RegisterMethods< SBThread >(), and StepOutOfFrame().

◆ StepOutOfFrame() [2/2]

void SBThread::StepOutOfFrame ( SBFrame frame,
SBError error 
)

◆ StepOver() [1/2]

void SBThread::StepOver ( lldb::RunMode  stop_other_threads = lldb::eOnlyDuringStepping)

Definition at line 585 of file SBThread.cpp.

References LLDB_RECORD_METHOD.

Referenced by lldb_private::repro::RegisterMethods< SBThread >(), and StepOver().

◆ StepOver() [2/2]

void SBThread::StepOver ( lldb::RunMode  stop_other_threads,
SBError error 
)

◆ StepOverUntil()

SBError SBThread::StepOverUntil ( lldb::SBFrame frame,
lldb::SBFileSpec file_spec,
uint32_t  line 
)

◆ StepUsingScriptedThreadPlan() [1/2]

SBError SBThread::StepUsingScriptedThreadPlan ( const char *  script_class_name)

◆ StepUsingScriptedThreadPlan() [2/2]

SBError SBThread::StepUsingScriptedThreadPlan ( const char *  script_class_name,
bool  resume_immediately 
)

◆ Suspend() [1/2]

bool SBThread::Suspend ( )

LLDB currently supports process centric debugging which means when any thread in a process stops, all other threads are stopped.

The Suspend() call here tells our process to suspend a thread and not let it run when the other threads in a process are allowed to run. So when SBProcess::Continue() is called, any threads that aren't suspended will be allowed to run. If any of the SBThread functions for stepping are called (StepOver, StepInto, StepOut, StepInstruction, RunToAddress), the thread will not be allowed to run and these functions will simply return.

Eventually we plan to add support for thread centric debugging where each thread is controlled individually and each thread would broadcast its state, but we haven't implemented this yet.

Likewise the SBThread::Resume() call will again allow the thread to run when the process is continued.

Suspend() and Resume() functions are not currently reference counted, if anyone has the need for them to be reference counted, please let us know.

Definition at line 1062 of file SBThread.cpp.

References LLDB_RECORD_METHOD_NO_ARGS.

Referenced by lldb_private::repro::RegisterMethods< SBThread >(), and Suspend().

◆ Suspend() [2/2]

bool SBThread::Suspend ( SBError error)

◆ UnwindInnermostExpression()

SBError SBThread::UnwindInnermostExpression ( )

Friends And Related Function Documentation

◆ lldb_private::QueueImpl

friend class lldb_private::QueueImpl
friend

Definition at line 213 of file SBThread.h.

◆ SBBreakpoint

friend class SBBreakpoint
friend

Definition at line 205 of file SBThread.h.

◆ SBBreakpointCallbackBaton

friend class SBBreakpointCallbackBaton
friend

Definition at line 207 of file SBThread.h.

◆ SBBreakpointLocation

friend class SBBreakpointLocation
friend

Definition at line 206 of file SBThread.h.

◆ SBDebugger

friend class SBDebugger
friend

Definition at line 211 of file SBThread.h.

◆ SBExecutionContext

friend class SBExecutionContext
friend

Definition at line 208 of file SBThread.h.

◆ SBFrame

friend class SBFrame
friend

Definition at line 209 of file SBThread.h.

◆ SBProcess

friend class SBProcess
friend

Definition at line 210 of file SBThread.h.

◆ SBQueueItem

friend class SBQueueItem
friend

Definition at line 214 of file SBThread.h.

◆ SBThreadPlan

friend class SBThreadPlan
friend

Definition at line 215 of file SBThread.h.

◆ SBValue

friend class SBValue
friend

Definition at line 212 of file SBThread.h.

Referenced by GetCurrentException(), and GetStopReturnValue().


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