Opened 7 years ago
Closed 7 years ago
#13799 closed bug (fixed)
Debugger doesn't display variables and registers in runtime_loader
Reported by: | KapiX | Owned by: | bonefish |
---|---|---|---|
Priority: | normal | Milestone: | Unscheduled |
Component: | Build System | Version: | R1/Development |
Keywords: | runtime loader | Cc: | bonefish, korli |
Blocked By: | Blocking: | ||
Platform: | All |
Description
I have built runtime_loader and libroot with DEBUG enabled and booted the resulting system, and the Debugger loads the source files for runtime_loader, but I don't see variables and registers.
gcc2h hrev51597
Files to reproduce here: http://haiku.kacperkasper.pl/ixiontests.zip
Change History (5)
comment:1 by , 7 years ago
comment:2 by , 7 years ago
Cc: | added |
---|---|
Component: | Applications/Debugger → Build System |
Keywords: | runtime loader added |
Owner: | changed from | to
After reproducing this and looking at a dump of the runtime loader's ELF sections, the issue here is actually relatively "straightforward". The final binary for the loader is winding up with every .debug information section *except* one of .{debug,eh}_frame. As a result, the actual instructions needed to unwind the stack frames are not available, and consequently also the necessary data to resolve variables/full registers. However, I'm uncertain as to why this is occurring. It may have to do with the custom ldscripts used to link the loader. CCing a few people who might be able to shed some light.
follow-up: 4 comment:3 by , 7 years ago
http://cgit.haiku-os.org/haiku/tree/src/system/ldscripts/x86/runtime_loader.ld
The eh_frame is in the DISCARD section here, which would explain it being removed?
comment:4 by , 7 years ago
Replying to PulkoMandy:
http://cgit.haiku-os.org/haiku/tree/src/system/ldscripts/x86/runtime_loader.ld
The eh_frame is in the DISCARD section here, which would explain it being removed?
Would there be any potential problem with adding it back? Alternatively, is it possible for the linker script to distinguish between a build with debugging information vs one without when deciding whether or not to discard? I assume that was simply done initially as an optimization, since the loader is compiled with -fno-exceptions
, which would theoretically make that section unnecessary under normal circumstances.
I've grabbed the files in question if you want to remove them from your host again. I'll try to look into this in the next few days as time permits.