FreeBSD The Power to Serve

LLDB Debugger Improvements

Contact: Kamil Rytarowski <kamil@moritz.systems>
Contact: Michał Górny <mgorny@moritz.systems>

The LLDB project builds on libraries provided by LLVM and Clang to provide a great modern debugger. It uses the Clang ASTs and the expression parser, LLVM JIT, LLVM disassembler, etc so that it provides an experience that “just works”. It is also blazingly fast and more permissively licensed than GDB, the GNU Debugger.

FreeBSD includes LLDB in the base system. At present, it has some limitations in comparison with the GNU GDB debugger, and does not yet provide a complete replacement. This project spanned from January 2021 to April 2021 and aimed to improve the compatibility of LLDB with FreeBSD and extend it with new features.

The initial work was focused on finishing the port of the FreeBSD process plugin to a new client-server model. After porting all previously supported architectures we were able to remove the legacy plugin. Afterwards, we have implemented support for tracing fork(2) and vfork(2) syscalls using a model that is compatible with the follow-fork-mode setting from GDB. Finally, we have worked on improving support for core dumps in LLDB. We have used the newly introduced PT_COREDUMP ptrace(2) request to support creating a core dump of a stopped program without crashing it. During our work, we have fixed many bugs and improved the state of the test suite on amd64 and arm64 architectures.

The introduced changes are expected to be shipped with LLDB 13.0.

The overall experience of FreeBSD/LLDB developers and advanced users on this rock solid Operating System reached the state known from other environments. Furthermore, the FreeBSD-focused work also resulted in generic improvements, enhancing the LLDB support for Linux and NetBSD.

Sponsor: The FreeBSD Foundation


Last modified on: July 24, 2021 by Daniel Ebdrup Jensen