rhboot / shim

UEFI shim loader
Other
816 stars 284 forks source link

Force gcc to produce DWARF4 so that gdb can use it #607

Open mikebeaton opened 10 months ago

mikebeaton commented 10 months ago

Addresses #606.

I am not sure if the location where I have added the flags is ideal, though it does make shim debuggable again.

supperpiccle commented 4 months ago

I ran into this exact problem and the solution here fixed it.

However, I tested with a version of gdb that supports DWARF 5. Both gdb 12.1 and 13.1 ran into this issue. I suspect it's an issue with this piece in the makefile

%.efi.debug : %.so ifneq ($(OBJCOPY_GTE224),1) $(error objcopy >= 2.24 is required) endif $(OBJCOPY) -D -j .text -j .sdata -j .data \ -j .dynamic -j .rodata -j .rel* \ -j .rela* -j .dyn -j .reloc -j .eh_frame -j .sbat \ -j .sbatlevel \ -j .debug_info -j .debug_abbrev -j .debug_aranges \ -j .debug_line -j .debug_str -j .debug_ranges \ -j .note.gnu.build-id \ $< $@

I don't know anything about the differences between version 4 and 5, but I suspect the objcopy there isn't conforming to whatever specification version 5 requires. Long term, I think the solution would be to run down what's wrong here.