Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Meta Engineering 6 min read Deep dive hardMaster

Extending LLDB to Debug Applications That Span CPUs and GPUs

LLDB gains a vendor-neutral accelerator plugin architecture in lldb-server that represents the CPU and GPU as separate debugger targets, each with its own architecture, threads, registers and address space, while presenting them in one debugging session. Plugins set internal host breakpoints to detect runtime events, initialize the vendor's device debugging API, and hand LLDB a second GDB-remote connection for the device target, so existing abstractions handle device threads, memory, modules and breakpoints. A mock accelerator plugin allows hardware-independent testing in the LLVM suite, core-dump plugins support postmortem debugging, and most of the framework has been upstreamed. The aim is that supporting new hardware needs only a vendor plugin rather than a separate debugger like ROCgdb or CUDA-GDB.

Assumes: debugger internalsGDB remote protocolGPU execution model

Related posts

  • Progress Report: Linux 7.3

    Asahi Linux hardMaster

    Asahi Linux's 7.3-cycle report covers upstream submission of the macaudio and AVD (~13,000 lines) drivers, initial M4 Pro/Max and M5 Devicetrees, and M3 support going generally available with DCP enabling sleep and the notch area. m1n1 now runs three EL1 VMs (macOS, SPTM, and the Secure Kernel with Exclaves) to reverse engineer M5 macOS. Thunderbolt support ships with USB3, XDomain and networking only, because Apple's RTKit-based controller breaks Intel-centric kernel assumptions. Google's Android P3S patchset switches TCR page granularity per process, letting x86 Windows games run with 4 KiB pages outside muvm and avoid its ~20% penalty, though it won't ship until Google's upstream plans are clear.

  • The Debugger is Here

    Zed mediumAdept

    Zed now ships a native debugger built on the Debug Adapter Protocol, with out-of-the-box support for Rust, C/C++, JavaScript, Go and Python. "Locators" turn build tasks such as Cargo runs into debug configurations automatically. Internally it uses a two-layer design: a data layer talks to debug adapters, caches responses by request arguments, lazily fetches and invalidates stale state, and a UI layer queries only what it renders, which sets up future collaborative debugging. Extensions can plug in any of the 70+ DAP implementations, and inline variable values come from Tree-sitter scope queries rather than the LSP inline-values request.

  • Progress Report: Linux 6.17

    Asahi Linux easyNovice

    The Apple SMC core driver, along with its GPIO and reboot controllers, has landed upstream in Linux 6.17, joining Devicetree schema changes that stabilize how the future GPU driver reads firmware data. Four-level pagetables in the DART IOMMU driver enable M2 Pro/Max/Ultra support in 6.18. m1n1 gains a CI-built UEFI bundle and a sound Rust implementation of Apple Device Tree parsing with no measured speed loss, and future m1n1 releases will require Rust. Other updates include 64-bit Windows games running in WINE via FEX outside muvm, tuxvdmtool for Linux-hosted device bringup, and the Asahi compute-shader emulation of geometry and tessellation shaders becoming shared Mesa code ('poly') for drivers like Panfrost.

  • Reverse debugging at scale

    Meta Engineering hardMaster

    Meta continuously records Intel Processor Trace (Intel PT) data for all running processes in production, keeping it in a bounded circular buffer. An eBPF kernel probe notifies the collector within milliseconds of a crash, so the crashed process's trace is saved before other processes overwrite it. Traces and binaries are stored for offline analysis, where an LLDB plugin decodes taken and not-taken branches against the binary, symbolicates the executed instructions, and builds a function call tree that makes reverse-step-over and reverse breakpoints cheap. The same timestamped traces also support latency analysis that sampled call stacks miss, with visualization planned for Meta's Tracery tool and VSCode.

  • Hardening eBPF for runtime security: Lessons from Datadog Workload Protection

    Datadog Engineering hardMaster

    Five years of running Datadog Workload Protection, an eBPF-based runtime security agent supporting kernels from 4.15 to 6.18, distilled into six production lessons. They cover getting programs to load, attach and keep firing across kernels and distributions; capturing and enriching data correctly; auditing eBPF use to reduce attack surface; coexisting with other eBPF users on a host; controlling performance cost; and shipping changes safely. Concrete pitfalls include verifier differences between kernels, inlined or renamed hook points, missed 32-bit compat syscalls and per-syscall tracepoints, and gaps from io_uring, openat2 and unusual exec paths like binfmt_misc. Mitigations include a CI matrix of tested kernels, the shared open source ebpf-manager Go library that refuses to start without a minimal set of loaded programs, and wrappers that hide verifier quirks.

The quest for software engineering knowledge.

Look:
Layout: