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

<span title='2024-05-24 06:00:00 +0000 UTC'>May 24, 2024</span>

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

<span title='2024-02-17 00:00:00 +0000 UTC'>February 17, 2024</span>

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.

<span title='2021-03-10 05:35:06 +0000 UTC'>March 10, 2021</span>

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: 1 int foo() { 2 return 1; 3 } 4 int bar() { 5 return 2; 6 } 7 int baz() { 8 return 3; 9 } 10 int main(int argc, char** argv) { 11 return foo() + bar() + baz(); 12 } 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....

<span title='2020-02-20 06:00:00 +0000 UTC'>February 20, 2020</span>

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

<span title='2019-12-22 20:37:03 +0000 UTC'>December 22, 2019</span>

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

<span title='2019-12-20 21:00:00 +0000 UTC'>December 20, 2019</span>