Generating startup debug symbols
To generate debug symbols for the startup program, you must recompile both the startup library and the board's startup program with debug information.
- Build the startup library and the target board's startup program with debug information. (Ensure any modifications you require are complete before you build.)
- Rebuild the image and symbol file.
- Load the symbol file into the hardware debugger program.
- Transfer the startup to the board; for example, write the startup into flash memory using a flash writer or JTAG, transfer it over a serial or network connection, or load it from an SD card or other removable media.
# cd bsp_working_dir/src/hardware/startup/lib/target/a.be
# make clean
# make CCOPTS=-g
# cp libstartup.a bsp_working_dir/board_name/install/processor/lib
# make install
The above steps recompile the startup library (libstartup.a) with debug information and copy this library to the install/processor/lib directory, assuming that the BSP is configured to look for this library first in this directory. The make install is optional, and copies libstartup.a to /processor/usr/lib.
# cd bsp_working_dir/board_name/src/hardware/startup/boards/board_name/target/be
# make clean
# make CCOPTS=-g
# make install
The above steps generate the file startup-board_name with symbol and debug information. The make install is necessary, and copies startup-board_name into the install directory, bsp_working_dir/board_name/install/ processor/boot/sys.
# cd bsp_working_dir/board_name/images
[image=0x10000]
[virtual=processor,binary +compress] .bootstrap = {
[+keeplinked] startup-board_name -vvv -D8250
PATH=/proc/boot
procnto-smp-instr -vv
}
The +keeplinked option instructs mkifs to generate a symbol file that represents the debug information, positioned by the specified offset in the image filesystem.
# cd bsp_working_dir/board_name/images
# make clean
# make all
otherwise:
# mkifs -v -r ../install myfile.build image
These commands create the symbol file, startup-board_name.sym. You can use the objdump utility to view the ELF information.
# objdump -t startup-board_name.sym | less
- bsp_working_dir/src/hardware/startup/lib
- bsp_working_dir/src/hardware/startup/lib/public/target
- bsp_working_dir/src/hardware/startup/lib/public/sys
- bsp_working_dir/src/hardware/startup/lib/target
- bsp_working_dir/board_name/src/hardware/startup/boards/ board_name