#lldb #debugger

sys lldb-sys

Raw bindings to the LLDB C++ API. LLDB is the debugger that is part of the LLVM project and is the default system debugger on Mac OS X. Building and using this is currently slightly tricky, so be sure to see the README.md in the repository.

29 releases

Uses new Rust 2021

0.0.29 Sep 15, 2022
0.0.27 Oct 4, 2021
0.0.26 May 25, 2021
0.0.21 Oct 3, 2018
0.0.10 Jul 19, 2016

#163 in Debugging

Download history 144/week @ 2022-06-05 5/week @ 2022-06-12 9/week @ 2022-06-19 7/week @ 2022-06-26 31/week @ 2022-07-03 31/week @ 2022-07-10 60/week @ 2022-07-17 39/week @ 2022-07-24 32/week @ 2022-07-31 12/week @ 2022-08-07 7/week @ 2022-08-14 43/week @ 2022-08-21 15/week @ 2022-08-28 37/week @ 2022-09-04 58/week @ 2022-09-11 39/week @ 2022-09-18

183 downloads per month
Used in lldb


14K SLoC

C++ 9K SLoC // 0.1% comments Rust 5K SLoC // 0.0% comments Shell 3 SLoC


Dual licensed under the MIT and Apache 2 licenses. The C bindings for LLDB are licensed under the same license as LLVM.


This crate works with Cargo and is on crates.io. Add it to your Cargo.toml like so:

lldb-sys = "0.0.29"


Install the lldb and liblldb-dev packages for your platform so that you have both LLDB itself installed as well as the headers and other support files required.


You will need to have 2 environment variables set to do the build:

  • LLVM_ROOT - This points to the root of the LLVM source tree.
  • LLVM_BUILD_ROOT - This points to the root of an LLVM build directory. This may be the same as the LLVM source tree, especially if you're working from a binary install.

For now, you will have to set an @rpath manually on your executables so that they can find the LLDB.framework at runtime. This can be done with install_name_tool:

install_name_tool -add_rpath /Applications/Xcode.app/Contents/SharedFrameworks target/debug/examples/barebones

Alternatively, for testing and local work, you can set the DYLD_FRAMEWORK_PATH:

export DYLD_FRAMEWORK_PATH=/Applications/Xcode.app/Contents/SharedFrameworks


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Binding Re-generation

If something happens where the Rust bindings need to be re-generated, they were generated from this set of files with bindgen. We have a script to automate some of the processing that is needed:


After running that, you will want to selectively merge the changes with what was previously there as the output of this process is hand-edited to add usage of libc as well as doc comments in critical places.