官网地址:
https://lldb.llvm.org/index.html
LLDB is a next generation, high-performance debugger. It is built as a set of reusable components which highly leverage existing libraries in the larger LLVM Project, such as the Clang expression parser and LLVM disassembler.
LLDB is the default debugger in Xcode on macOS and supports debugging C, Objective-C and C++ on the desktop and iOS devices and simulator.
All of the code in the LLDB project is available under the “Apache 2.0 License with LLVM exceptions”.
Using LLDB
For an introduction into the LLDB command language, head over to the LLDB Tutorial. For users already familiar with GDB there is a cheat sheet listing common tasks and their LLDB equivalent in the GDB to LLDB command map.
There are also multiple resources on how to script LLDB using Python Python Reference is a great starting point for that.
Compiler Integration Benefits
LLDB converts debug information into Clang types so that it can leverage the Clang compiler infrastructure. This allows LLDB to support the latest C, C++, Objective-C and Objective-C++ language features and runtimes in expressions without having to reimplement any of this functionality. It also leverages the compiler to take care of all ABI details when making functions calls for expressions, when disassembling instructions and extracting instruction details, and much more.
The major benefits include:
- Up to date language support for C, C++, Objective-C
- Multi-line expressions that can declare local variables and types
- Utilize the JIT for expressions when supported
- Evaluate expression Intermediate Representation (IR) when JIT can’t be used
Tutorial
Here’s a short precis of how to run lldb if you are familiar with the gdb command set. We will start with some details on lldb command structure and syntax to help orient you.