Reputation: 51
I am working on an STM32 processor. Using readelf -w, tons of debug information could be extracted from my elf file. A short piece of the output is shown below:
<1><3faf>: Abbrev Number: 30 (DW_TAG_variable)
<3fb0> DW_AT_name : (indirect string, offset: 0x24e): ITM_RxBuffer
<3fb4> DW_AT_decl_file : 19
<3fb5> DW_AT_decl_line : 1742
<3fb7> DW_AT_type : <0x3f48>
<3fbb> DW_AT_external : 1
<3fbc> DW_AT_declaration : 1
dwarfdump also confirms debug info is available in elf file.
I am using the following software packages: Eclipse Juno arm-2011.03/bin/arm-none-eabi-gdb OpenOCD and JTAG key
After producing elf file, burn it into STM32 processor, and start the debug session in Eclipse. JTAG could be started and stopped, so I guess OpenOCD deamon is fine. Breakpoint cannot be set due to the fact "No symbol table is loaded". One thing I noticed is among the "variable/breakponts/register/modules" window, the modules tab showing the elf file loaded contains followiing details: Type: executable symbols: not loaded symbol file: BuildResult.elf
In debug configuration->Startup tab, check/uncheck "Load image/Load symbols" make no difference. I am wondering how eclipse loads elf file contained symbol info into the debug process?
Any suggestions, hints, are greatly appreciated.
Upvotes: 5
Views: 1564
Reputation: 68004
I would suggest using something having plugins for your hardware. I would suggest STM32CubeIDE not the DIY Eclipse IDE.
My guess is that you use generic gdb
not arm-none-eabi-gdb
and it never worked for me when I was trying to use multiarch gdb
instead of dedicated one.
Upvotes: 0
Reputation: 399
This mostly cause by the fact that your program does not compile with the debug information. To fix this,
-ggdb
for gdb debug.Furthermore, it is nice to know that
-g
produces debugging information in native format (stabs, COFF, XCOFF, or DWARF 2).
-ggdb
produces gdb-friendly debugging information
-ggdb3
produces additional debugging information
Upvotes: 0