Issue with debug symbols with garbage collector

Michael Eager eager@eagercon.com
Wed Apr 20 19:22:15 GMT 2022


On 4/20/22 02:15, Nagaraju Mekala via Gcc-help wrote:
> Hello All,
> 
> When I enable the garbage collector for the microblaze compiler compilation
> seems to be fine, but the debug symbols are not generated properly.
> 
> If we set a breakpoint at 0x0 it is showing some different location, we can
> see the same in the objdump as well.

What different location?

> 
> 
> Disassembly of section .vectors.reset:
> 
> 00000000 <_start>:
> *
> *
> ****************************************************************************/
> void microblaze_register_handler(XInterruptHandler Handler, void *DataPtr)
> {
>     MB_InterruptVectorTable[0].Handler = Handler;
>     0: b0008000 imm -32768
>     4: b8080000 brai 0
> 
> for the _start symbols "void microblaze_register_handler(XInterruptHandler
> Handler, void *DataPtr)" is coming up.

It looks like both _start and microblaze_register_handler are both at 0.
What did you expect?

GDB picks the first symbol which matches the address.

> If I disable the garbage-collector then everything seems fine.
> I have used "-ffunction-sections and -fdata-sections" options during
> compilation and -gc-sections during linking command.
> 
> Please let me know how to tell the garbage collector to not delete
> debug_loc information.

Why do you think that the garbage collector is deleting debug info?

-- 
Michael Eager


More information about the Gcc-help mailing list