LLDB API Documentation

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Members

Public Types | Public Member Functions | Static Public Member Functions | Protected 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 ()
bool | IsValid () const
void | Clear ()
lldb::StopReason | GetStopReason ()
size_t | GetStopReasonDataCount ()
uint64_t | GetStopReasonDataAtIndex (uint32_t idx)
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
void | StepOver (lldb::RunMode stop_other_threads=lldb::eOnlyDuringStepping)
void | StepInto (lldb::RunMode stop_other_threads=lldb::eOnlyDuringStepping)
void | StepInto (const char *target_name, lldb::RunMode stop_other_threads=lldb::eOnlyDuringStepping)
void | StepOut ()
void | StepOutOfFrame (lldb::SBFrame &frame)
void | StepInstruction (bool step_over)
SBError | StepOverUntil (lldb::SBFrame &frame, lldb::SBFileSpec &file_spec, uint32_t line)
void | RunToAddress (lldb::addr_t addr)
SBError | ReturnFromFrame (SBFrame &frame, SBValue &return_value)
bool | Suspend ()
bool | Resume ()
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::SBThread & | operator= (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 | GetStatus (lldb::SBStream &status) const

## 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)

## Protected Member Functions

void | SetThread (const lldb::ThreadSP &lldb_object_sp)
SBError | ResumeNewPlan (lldb_private::ExecutionContext &exe_ctx, lldb_private::ThreadPlan *new_plan)

## Friends

class | SBBreakpoint
class | SBBreakpointLocation
class | SBFrame
class | SBProcess
class | SBDebugger
class | SBValue

## Detailed Description

Definition at line 21 of file SBThread.h.

## Member Enumeration Documentation

anonymous enum

Enumerator:

  eBroadcastBitStackChanged |
  eBroadcastBitThreadSuspended |
  eBroadcastBitThreadResumed |
  eBroadcastBitSelectedFrameChanged |
  eBroadcastBitThreadSelected |

Definition at line 24 of file SBThread.h.

## Constructor & Destructor Documentation

lldb::SBThread::SBThread | ( |  | ) |

lldb::SBThread::SBThread | ( | const lldb::SBThread & | thread | ) |

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

lldb::SBThread::~SBThread | ( |  | ) |

## Member Function Documentation

void lldb::SBThread::Clear | ( |  | ) |

static bool lldb::SBThread::EventIsThreadEvent | ( | const SBEvent & | event | ) |

static

static const char* lldb::SBThread::GetBroadcasterClassName | ( |  | ) |

static

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

lldb::SBFrame lldb::SBThread::GetFrameAtIndex | ( | uint32_t | idx | ) |

uint32_t lldb::SBThread::GetIndexID | ( |  | ) | const

const char* lldb::SBThread::GetName | ( |  | ) | const

uint32_t lldb::SBThread::GetNumFrames | ( |  | ) |

lldb::SBProcess lldb::SBThread::GetProcess | ( |  | ) |

const char* lldb::SBThread::GetQueueName | ( |  | ) | const

lldb::SBFrame lldb::SBThread::GetSelectedFrame | ( |  | ) |

static SBFrame lldb::SBThread::GetStackFrameFromEvent | ( | const SBEvent & | event | ) |

static

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

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

lldb::StopReason lldb::SBThread::GetStopReason | ( |  | ) |

uint64_t lldb::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

size_t lldb::SBThread::GetStopReasonDataCount | ( |  | ) |

Get the number of words associated with the stop reason. See also GetStopReasonDataAtIndex().

SBValue lldb::SBThread::GetStopReturnValue | ( |  | ) |

static SBThread lldb::SBThread::GetThreadFromEvent | ( | const SBEvent & | event | ) |

static

lldb::tid_t lldb::SBThread::GetThreadID | ( |  | ) | const

bool lldb::SBThread::IsStopped | ( |  | ) |

bool lldb::SBThread::IsSuspended | ( |  | ) |

bool lldb::SBThread::IsValid | ( |  | ) | const

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

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

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

bool lldb::SBThread::Resume | ( |  | ) |

SBError lldb::SBThread::ResumeNewPlan | ( | lldb_private::ExecutionContext & | exe_ctx,
|  | lldb_private::ThreadPlan * | new_plan
| ) |  |

protected

SBError lldb::SBThread::ReturnFromFrame | ( | SBFrame & | frame,
|  | SBValue & | return_value
| ) |  |

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

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

void lldb::SBThread::SetThread | ( | const lldb::ThreadSP & | lldb_object_sp | ) |

protected

void lldb::SBThread::StepInstruction | ( | bool | step_over | ) |

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

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

void lldb::SBThread::StepOut | ( |  | ) |

void lldb::SBThread::StepOutOfFrame | ( | lldb::SBFrame & | frame | ) |

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

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

bool lldb::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, RunToAddres), the thread will not be allowed to run and these funtions 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.

## Friends And Related Function Documentation

friend class SBBreakpoint

friend

Definition at line 199 of file SBThread.h.

friend class SBBreakpointLocation

friend

Definition at line 200 of file SBThread.h.

friend class SBDebugger

friend

Definition at line 203 of file SBThread.h.

friend class SBFrame

friend

Definition at line 201 of file SBThread.h.

friend class SBProcess

friend

Definition at line 202 of file SBThread.h.

friend class SBValue

friend

Definition at line 204 of file SBThread.h.

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

- SBThread.h