When working and debugging a bootloader, debugging can be a challenge: During debugging the bootloader, a new binary gets loaded into the microcontroller address space which is unknown to the debugger. As soon as I step into the newly loaded binary, I only
When working and debugging a bootloader, debugging can be a challenge: During debugging the bootloader, a new binary gets loaded into the microcontroller address space which is unknown to the debugger. As soon as I step into the newly loaded binary, I only see assembly code, with that ugly “No source available” in Eclipse:
But wait: GDB is able to do pretty much everything you can imagine, so here is how to debug multiple binaries with GDB and Eclipse, and to turn the above into something which is easy to debug:
In many use cases, it is necessary to debug multiple binaries. One use case is with a bootloader (see “Serial Bootloader for the Freedom Board with Processor Expert“) or with using libraries (see “Creating and using Libraries with ARM gcc and Eclipse“). What is common in these cases that the debugger might not have the necessary debug information (or ‘symbolics’) do display the source files and the variable information.
Code and Debug Information
‘Debug information’ is embedded and part of the.elf (ELF) which usually has the DWARF debug information. When debugging a.elf file, that combined information is passed to the debugger, as shown below in the Eclipse launch configuration for GDB:
- Symbols file: this specifies which file is used for the debug information. The debug information is kept on the host and not downloaded to the target.