Crate lldb [−] [src]
LLDB
This crate provides a safe binding to the public API for LLDB, the debugger provided by the LLVM project. LLDB provides a modern, high performance debugger framework and is the default debugger for Mac OS X and iOS.
Installation
This crate works with Cargo and is on crates.io.
Add it to your Cargo.toml
like so:
lldb = "0.0.7"
Mac OS X Installation Notes
On Mac OS X, this library relies upon being able to find
the LLDB.framework
that is provided by Xcode.app.
In your own application, you will need to configure the
@rpath
for your execuable to point to the location
of the LLDB.framework
that you are using. Doing this
automatically is not currently supported by Cargo.
For testing, you can use the version provided by Xcode.app by setting an environment variable:
export DYLD_FRAMEWORK_PATH=/Applications/Xcode.app/Contents/SharedFrameworks
Linux Installation Notes
Support for building this has not yet been provided for Linux. Contributions are welcome!
Windows Installation Notes
Support for building this has not yet been provided for Linux. Contributions are welcome!
Usage
The primary entry point is SBDebugger
. This will be how you
create a debug target and begin the actually interesting stuff.
Important Classes
The LLDB API provides many structs and a wide range of functionality. Some of the most common usages will involve these structs and their corresponding methods:
SBDebugger
: Manages the entire debug experience and createsSBTarget
s.SBTarget
: The target program running under the debugger.SBProcess
: The process associated with the target program.SBThread
: A thread of execution.SBProcess
containsSBThread
s.SBFrame
: One of the stack frames associated with a thread.SBThread
containsSBFrame
s.SBSymbolContext
: A container that stores various debugger related info.SBValue
: The value of a variable, a register, or an expression.SBModule
: An executable image and its associated object and symbol files.SBTarget
containsSBModule
s.SBBreakpoint
: A logical breakpoint and its associated settings.SBTarget
containsSBBreakpoint
s.SBSymbol
: The symbol possibly associated with a stack frame.SBCompileUnit
: A compilation unit, or compiled source file.SBFunction
: A generic function, which can be inlined or not.SBBlock
: A lexical block.SBFunction
containsSBBlock
s.SBLineEntry
: Specifies an association with a contiguous range of instructions and a source file location.SBCompileUnit
containsSBLineEntry
s.
Support and Maintenance
I am developing this library largely on my own so far. I am able to offer support and maintenance, but would very much appreciate donations via Patreon. I can also provide commercial support, so feel free to contact me.
Structs
FilePermissions | |
LaunchFlags | |
Permissions | |
SBAddress |
A section + offset based address class. |
SBAttachInfo |
Configuration for attaching to a process. |
SBBlock |
A lexical block. |
SBBreakpoint |
A logical breakpoint and its associated settings. |
SBBreakpointList |
A list of breakpoints. |
SBBreakpointLocation |
One unique instance (by address) of a logical breakpoint. |
SBBreakpointLocationIter |
An iterator over the locations in an |
SBBroadcaster |
An entity which can broadcast events. |
SBCompileUnit |
A compilation unit or compiled source file. |
SBData |
A block of data. |
SBDebugger |
Creates |
SBDebuggerTargetIter | |
SBError |
A container for holding any error code. |
SBEvent |
An event. |
SBExpressionOptions | |
SBFileSpec |
A file specification that divides the path into a directory and basename. |
SBFileSpecList |
A list of filespecs. |
SBFrame |
One of the stack frames associated with a thread. |
SBFunction |
A generic function, which can be inlined or not. |
SBInstruction |
A machine instruction. |
SBInstructionList |
A list of machine instructions. |
SBInstructionListIter |
An iterator over the instructions in an |
SBLaunchInfo |
Configuration for launching a process. |
SBLineEntry |
Specifies an association with a contiguous range of instructions and a source file location. |
SBListener |
Listen for debugger events. |
SBModule |
An executable image and its associated object and symbol files. |
SBModuleSpec |
A description of an |
SBPlatform |
A platform that can represent the current host or a remote host debug platform. |
SBProcess |
The process associated with the target program. |
SBProcessEvent | |
SBProcessEventRestartedReasonIter |
Iterate over the restart reasons in a process event. |
SBProcessThreadIter | |
SBQueue |
A |
SBQueueItem |
A work item enqueued on a libdispatch aka Grand Central Dispatch (GCD) queue. |
SBSection | |
SBStream |
A destination for streaming data output. By default, this is a string stream, but it can be redirected to a file. |
SBStringList |
A list of strings. |
SBStringListIter |
An iterator over an |
SBStructuredData |
The value of a variable, register or expression. |
SBSymbol |
The symbol possibly associated with a stack frame. |
SBSymbolContext |
A container that stores various debugger related info. |
SBTarget |
The target program running under the debugger. |
SBTargetBreakpointIter |
Iterate over the breakpoints in a target. |
SBTargetEvent | |
SBTargetEventModuleIter |
Iterate over the modules referenced from a target event. |
SBTargetWatchpointIter |
Iterate over the watchpoints in a target. |
SBThread |
A thread of execution. |
SBThreadEvent |
A thread event. |
SBThreadFrameIter | |
SBType | |
SBTypeList |
A list of types. |
SBValue |
The value of a variable, register or expression. |
SBValueList |
A list of values. |
SBVariablesOptions | |
SBWatchpoint |
An instance of a watch point for a specific target program. |
SymbolContextItem |
These mask bits allow a common interface for queries that can limit the amount of information that gets parsed to only the information that is requested. These bits also can indicate what actually did get resolved during query function calls. |
TypeClass |
Enums
AccessType | |
AddressClass | |
BasicType | |
BreakpointEventType | |
ByteOrder |
Byte order definitions. |
CommandArgumentType | |
CommandFlags | |
ConnectionStatus | |
DescriptionLevel | |
DisassemblyFlavor |
Which syntax should be used in disassembly? |
DynamicValueType | |
EmulateInstructionOptions | |
Encoding |
Register encoding definitions. |
ErrorType | |
ExpressionEvaluationPhase | |
ExpressionResults | |
Format |
Display format definitions. |
FrameComparison | |
FunctionNameType | |
GdbSignal | |
InputReaderAction | |
InputReaderGranularity | |
InstrumentationRuntimeType | |
LanguageType | |
MatchType | |
MemberFunctionKind | |
PathType | |
QueueItemKind | |
QueueKind | |
RegisterKind | |
ReturnStatus | |
RunMode |
Thread run modes. |
ScriptLanguage | |
SectionType | |
StateType |
Process and thread states. |
StopReason |
Thread stop reasons. |
SymbolType | |
TemplateArgumentKind | |
TypeFlags | |
TypeOptions | |
TypeSummaryCapping | |
ValueType | |
WatchpointEventType | |
WatchpointKind |
Type Definitions
lldb_addr_t |
Storage for the value of an address. |
lldb_offset_t |
Storage for an offset between 2 addresses in memory. |
lldb_pid_t |
Storage for an OS process ID. |
lldb_tid_t |
Storage for an OS thread ID. |
lldb_user_id_t |
Storage for an OS user ID. |