Debugging (rust built) UEFI programs (running in Qemu) on Linux
Posted: Mon Jul 13, 2026 9:19 am
Has anyone has any success with source-level debugging a UEFI program in Linux?
Debugging my kernel is fairly straight-forward; I build an elf object with debug info, and use that for symbols while connecting to Qemu's remote gdb server (localhost:1234).
The same scenario somewhat works for the bootloader, except I'm stuck debugging at the assembly level because:
* Rust generates windows-style pdb debug symbols with GDB doesn't understand
* Attempts to add a custom UEFI target w/ dwarf debug symbols to Rust haven't been successful (has anybody succeeded in this? I even tried debugging through with Gemini, but was never successful)
* lldb supports pdb debug symbols, but doesn't seem to want to set breakpoints (it'll display then via `image lookup -r -n <sym>`, but wont set a breakpoint from a symbol name, and setting a breakpiont on the source line doesn't seem to take effect)
I'd prefer to just continue using gdb, as I already have a handful of debug scripts for the kernel, so it would be ideal if I could import debug/symbolic information from a UEFI binary into gdb, but so far haven't been successful.
Debugging my kernel is fairly straight-forward; I build an elf object with debug info, and use that for symbols while connecting to Qemu's remote gdb server (localhost:1234).
The same scenario somewhat works for the bootloader, except I'm stuck debugging at the assembly level because:
* Rust generates windows-style pdb debug symbols with GDB doesn't understand
* Attempts to add a custom UEFI target w/ dwarf debug symbols to Rust haven't been successful (has anybody succeeded in this? I even tried debugging through with Gemini, but was never successful)
* lldb supports pdb debug symbols, but doesn't seem to want to set breakpoints (it'll display then via `image lookup -r -n <sym>`, but wont set a breakpoint from a symbol name, and setting a breakpiont on the source line doesn't seem to take effect)
I'd prefer to just continue using gdb, as I already have a handful of debug scripts for the kernel, so it would be ideal if I could import debug/symbolic information from a UEFI binary into gdb, but so far haven't been successful.