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 macOS and iOS.
This crate works with Cargo and is on crates.io.
Add it to your
Cargo.toml like so:
lldb = "0.0.11"
On macOS, this library relies upon being able to find
LLDB.framework that is provided by Xcode.app.
In your own application, you will need to configure the
@rpath for your executable to point to the location
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:
lldb-dev packages for your platform so that
you have both LLDB itself installed as well as the headers and
other support files required.
Support for building this has not yet been provided for Windows. Contributions are welcome!
The primary entry point is
SBDebugger. This will be how you
create a debug target and begin the actually interesting stuff.
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 creates
SBTarget: The target program running under the debugger.
SBProcess: The process associated with the target program.
SBThread: A thread of execution.
SBFrame: One of the stack frames associated with a thread.
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.
SBBreakpoint: A logical breakpoint and its associated settings.
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.
SBLineEntry: Specifies an association with a contiguous range of instructions and a source file location.
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.
libdispatch(aka Grand Central Dispatch) queue.