Generating IPL debug symbols

Updated: April 19, 2023

To generate debug symbols for the IPL, you must recompile both the IPL library and the board's IPL with debug information.

The general procedure is:

  1. Build the IPL library and the target board's IPL. (Ensure any modifications you require are complete before you build.)
  2. Transfer the IPL to the board; for example, write the IPL 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.
  3. Modify the board_name.lnk file to output ELF format.
  4. Recompile the IPL library and the board's IPL source with debug information.
  5. Load the board's IPL ELF file containing debug information into the hardware debugger.
Note: Be sure to synchronize the source code, the IPL transferred to the board, and the IPL debug symbols.

To build the IPL library with debug information, execute the following:

# cd bsp_working_dir/src/hardware/ipl/lib/target/a.le
# make clean
# make CCOPTS=-g
# cp libipl.a bsp_working_dir/board_name/install/processor/lib
# make install 

The above steps recompile the target-specific IPL library (libipl.a) with debug information and copy this library to the board's 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 libipl.a to processor/usr/lib.

Modify the board_name.lnk file to output ELF format:

# cd bsp_working_dir/board_name/src/hardware/ipl/boards/board_name

Edit the file board_name.lnk, changing the first lines from:

TARGET(elf32-target)
OUTPUT_FORMAT(raw)
ENTRY(entry_vec)

to:

TARGET(elf32-target)
OUTPUT_FORMAT(elf32-target)
ENTRY(entry_vec)

You can now rebuild the board's IPL to produce debug symbols in ELF format, as follows:

# cd bsp_working_dir/board_name/src/hardware/ipl/boards/board_name/target/le
# make clean
# make CCOPTS=-g

The ipl-board_name file is now in ELF format with debug symbols from both the IPL library and the board's IPL.

You can use the objdump utility to view the ELF information. For example, to view the symbol information contained in the ipl-board_name file:

# objdump -t ipl-board_name | less

You can now import this file into a hardware debugger to provide the necessary symbol information. In addition to the ipl-board_name file, the hardware debugger needs the source code listings found in the following directories: