Hi everyone:
I am using scatter file to debug the relocated Cortex-M7 project named debug_m7, and the scatter file example as follows:
# define APP_FLASH_BASE 0x10000000
# define APP_RAM_BASE 0xA0000000
# define APP_RELOCATE_CODE_BASE 0xC0000000
# define APP_RELOCATE_DATA_BASE 0xC1000000
FLASH APP_FLASH_BASE{ AENTRYS APP_FLASH_BASE { startup.o (StartUp, +FIRST) sys_entry.o (StartUp,+DATA) }
APP_CODE +0 { * (+RO) } ;zero init data section ZINIT_DAT APP_RAM_BASE { * (+RW,+ZI) }
}
After buid I got a debug_m7.axf, I load the binary of the project to SDRAM with base address APP_RELOCATE_CODE_BASE for code and with base address APP_RELOCATE_DATA_BASE for data .
Finally, I relocated the code and data by modifying the global offset table and region table, as well as the _ scatterload_copy and _ scatterload_zeroinit, but I was unable to relocate the debugging symbols.
My question is:how can I load debug information into the debugger with diffrent offset for each load region use debugger command add-symbol-file or symbol-file?
Hello,
I moved your query to the Arm Development Studio forum.
You can use add-symbol-file image.axf 0xB0000000 to shift the symbols, but this would apply to all symbols within the image.
Could you perform two add-symbol-file commands to load the symbols twice. There will of course be multiple instances of all symbols as a result, but this is likely the only solution,
https://developer.arm.com/documentation/101471/2023-1/Arm-Debugger-commands/Arm-Debugger-commands-listed-in-alphabetical-order/add-symbol-file
I question why you need to do this? Why not simply build for the RELOCATE addresses and load directly?