[Lldb-commits] [lldb] [lldb][NativePDB] Handle UEFI binaries without predetermined load addresses (PR #173499)

via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 30 03:57:10 PST 2026


Nerixyz wrote:

> This could do with a test case. I guess we could build a "other relocatable image" and load that?

+1 on that. From the linked issue, it looks like LLDB crashed when just loading the file, so a basic test that runs LLDB with the file and prints out some symbols would suffice. You can put that in `lldb/test/Shell/SymbolFile/NativePDB/`. 

I'm not very familiar with UEFI and building of the images. From what I gathered in the LLVM tests, the following should produce a UEFI image with debug info:

```c
// efi.c
struct Foo {
    int a;
};

void EfiMain() {
    struct Foo f = {1};
    f.a = 2;
    f.a = 42;
}
```
```console
clang --target=x86_64-unknown-uefi -fuse-ld=lld-link -g efi.c -o uefi.efi
```

However, the resulting `uefi.efi` still has an image base (`dumpbin /HEADERS uefi.efi`), so the load address would be resolved. I'm probably doing something wrong here.

https://github.com/llvm/llvm-project/pull/173499


More information about the lldb-commits mailing list