欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

LLDB 调试器 - 官方网站

最编程 2024-03-01 22:20:44
...


官网地址:

​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.



  • ​Command Structure​
  • ​Loading a Program into lldb​
  • ​Setting Breakpoints​
  • ​Breakpoint Names​
  • ​Setting Watchpoints​
  • ​Starting or Attaching to Your Program​
  • ​Controlling Your Program​
  • ​Examining Thread State​
  • ​Examining Stack Frame State​