=== LLDB Debugger Improvements

Links: +
link:https://www.moritz.systems/blog/lldb-freebsd-cpu-target-support-and-userland-debugging-improvements/[Moritz Systems Project Description] URL: link:https://www.moritz.systems/blog/lldb-freebsd-cpu-target-support-and-userland-debugging-improvements/[https://www.moritz.systems/blog/lldb-freebsd-cpu-target-support-and-userland-debugging-improvements/] +
link:https://www.moritz.systems/blog/freebsd-remote-process-plugin-on-non-x86-architectures/[Progress Report 1] URL: link:https://www.moritz.systems/blog/freebsd-remote-process-plugin-on-non-x86-architectures/[https://www.moritz.systems/blog/freebsd-remote-process-plugin-on-non-x86-architectures/] +
link:https://www.moritz.systems/blog/freebsd-legacy-process-plugin-removed/[Progress Report 2] URL: link:https://www.moritz.systems/blog/freebsd-legacy-process-plugin-removed/[https://www.moritz.systems/blog/freebsd-legacy-process-plugin-removed/] +
link:https://www.moritz.systems/blog/lldb-support-for-fork-and-vfork/[Progress Report 3] URL: https://www.moritz.systems/blog/lldb-support-for-fork-and-vfork/[https://www.moritz.systems/blog/lldb-support-for-fork-and-vfork/] +
link:https://github.com/moritz-systems/llvm-project[Git Repository] URL: link:https://github.com/moritz-systems/llvm-project[https://github.com/moritz-systems/llvm-project]

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 aimed to finish porting the FreeBSD platform support in LLDB to the modern client-server model on all architectures originally supported by LLDB on FreeBSD and removing the obsolete plugin.

After switching to the new process model, the project focused on implementing support for tracing ``fork(2)`` and ``vfork(2)`` syscalls.
The proposed model is compatible with the ``follow-fork-mode`` setting from GDB.
On fork, the debugger can either continuing tracing the parent and detach the child, or switch to tracing the child and detach the parent.
The new code makes it possible to debug child processes.
It also prevents software breakpoints from leaking to child processes and causing them to crash.

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.

TODO: we are currently working on adding a ``ptrace(2)`` request to create a core dump of the stopped program without crashing it.
Afterwards, we are planning to improve LLDB test coverage for core dump support and work on any issues we might hit.

Sponsor: The FreeBSD Foundation
