LLDB Debug Adapter Protocol (DAP)

Debug Adapter Protocol The Debug Adapter Protocol (DAP) defines a generic protocol for editors to talk to a debugger. Popular editors with DAP support include Visual Studio Code, Sublime Text, (Neo)vim and Emacs. If you’re familiar with the Language Server Protocol (LSP) you can think of DAP like LSP, but for debugging. Implementations of the debug adapter protocol generally come in two forms: An extension tailored to a specific editor. A standalone DAP server that can be used with any editor that supports the protocol....

May 24, 2024

Rich Disassembler for LLDB

LLVM is once again participating in Google Summer of Code (GSOC). For 2024 we have an exciting project to enrich the disassembler in LLDB. The project consists of using the variable location information from the debug info (DWARF) to annotate LLDB’s disassembler (and register read) output with the location and lifetime of source variables. You can find all the details on LLVM’s Google Summer of Code Ideas & Projects page....

February 17, 2024

Google Summer of Code 2021

Today Google announced the list of open-source organizations participating in the 2021 Google Summer of Code program. Together with Raphael and Pedro, I’ll be mentoring the following two projects: A structured approach to diagnostics in LLDB Lua scripted watchpoints in LLDB If you’re interested in either of these projects or have questions, feel free to reach out. For more information about GSoC itself check out the Summer of Code website.

March 10, 2021

LLDB Column Breakpoints

If you’ve ever used the debugger, chances are you’ve used a file and line number to set a breakpoint. Most of the time this provides enough granularity. Sometimes, though, more fine grained control would be helpful. Consider the following example: int foo() { return 1; } int bar() { return 2; } int baz() { return 3; } int main(int argc, char** argv) { return foo() + bar() + baz(); } Line Breakpoints Let’s say we want to step into the function baz on line 11 and can’t set a breakpoint on baz itself....

February 20, 2020

Lua Scripting in LLDB

LLDB is the debugger developed as part of the LLVM project. It is probably most known as the debugger in Xcode, but many use it as an alternative to GDB. Scripting in LLDB One thing that makes LLDB really powerful is how scriptable it is. It has a stable C++ API, called the SB API or Scripting Bridge API, which is accessible through Python. Following LLVM’s model of reusable components, most of LLDB constitutes a debugger library and the SB API is how tools like the command line driver interface with it....

December 22, 2019

Sanitizing C++ Python Modules

Python has great interoperability with C and C++ through extension modules. There are many reasons to do this, such as improving performance, accessing APIs not exposed by the language, or interfacing with libraries written in C or C++. Unlike Python however, C and C++ are not memory safe. Luckily, great tools exist to help diagnose these kind of issues. One of those tools is ASan (Address Sanitizer) which uses compiler instrumentation to detect memory errors at runtime....

December 20, 2019