How can I debug a self-relocating application with Xilinx System Debugger?
The System Debugger supports source level debugging of self-relocating programs such as u-boot.
A self-relocating program is a program which relocates its own code and data sections during run time.
The debug information available in these ELFs does not provide details about where the program sections will be relocated to.
For this reason, you must provide additional information to the debugger about the address to which the program sections will be relocated.
There are two ways to do this, either through the SDK GUI or the command line (XSDB).
Update the System Debugger launch configuration to provide the address to which program sections are relocated.
Check the box for "This is a self-relocating application" and give the address as in the screen capture below:
Launch the debug configuration.
When the program sections are relocated during runtime, the debugger will have enough information to support source level debugging of the relocated sections.
Use the memmap command to provide the address to which the program sections are allocated.
memmap -reloc <addr> -file <path-to-elf>
There is an example of how to debug U-Boot in the Xilinx wiki page that can be used as an example.