Page 1 of 1

Debugging (rust built) UEFI programs (running in Qemu) on Linux

Posted: Mon Jul 13, 2026 9:19 am
by carbonBased
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.

Re: Debugging (rust built) UEFI programs (running in Qemu) on Linux

Posted: Tue Jul 14, 2026 3:50 am
by iansjack
rust-gdb

Re: Debugging (rust built) UEFI programs (running in Qemu) on Linux

Posted: Tue Jul 14, 2026 6:24 am
by carbonBased
Hmm... interesting.
`rust-gdb` does allow me to set breakpoints, but it still isn't able to inspect locals or do any source level debugging.
That's one step closer than I was, though, which is nice.
Thanks!

Code: Select all

(gdb) add-symbol-file /home/jweeks/code/satus/target/x86_64-unknown-uefi/debug/satus.efi 0x7E191000
add symbol table from file "/home/jweeks/code/satus/target/x86_64-unknown-uefi/debug/satus.efi" at
	.text_addr = 0x7e191000
(y or n) y
Reading symbols from /home/jweeks/code/satus/target/x86_64-unknown-uefi/debug/satus.efi...
warning: remote target does not support file transfer, attempting to access files from local filesystem.
(No debugging symbols found in /home/jweeks/code/satus/target/x86_64-unknown-uefi/debug/satus.efi)
(gdb) b satus::set_framebuffer
Breakpoint 2 at 0x7e195c80
(gdb) c
Continuing.
[Switching to Thread 1.1]

Thread 1 hit Breakpoint 2, 0x000000007e195c80 in satus::set_framebuffer ()
(gdb) p config
No symbol table is loaded.  Use the "file" command.