This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Fully Qualified Symbols with Position Independent Code

Hello All,

I have position independent code loaded at two different addresses:

// load main application
load .\obj\app_main.axf

// load position independent application with offset 0x9000 to 0x10009000
load .\obj\app_position_independent.axf incremental 0x9000

// load the same position independent application again with offset 0xA000 to 0x1000A000
load .\obj\app_position_independent.axf incremental 0xA000

What is the correct format for a full qualified symbol name. I can create a breakpoint using:

BS \\app_position_independent\src/src_position_independent_code/app_position_independent_main.c\70, 1
But this format does not specify at which offset, therefore it's not fully qualified.
I also cannot set breakpoints from the source code view, as again there does not appear to be a way to full qualify the address.
Currently the only way that I can find to set breakpoints at the correct address is to use the Symbols view to Show code for, switch to the Disassembly view scroll down to the correct line and set a breakpoint at the absolute address.
How is Position Independent Code debugging supposed to work?
Parents
  • Loading identical debug files is unfortunately not well supported. As you noticed, the fully qualified names are the same and when setting a BP in C the debugger puts it at the address of the first matching symbol name.

    As a workaround, in your µVision project that builds the app_position_independent.axf, you can add a User Command for "After Build" that creates a copy of the axf using Key Sequences like this:

    CMD /C "copy #L $L@L2.axf"

    which in this case creates a app_position_independent2.axf. On the second load use the app_position_independent2.axf. This gives different fully qualified symbols for the loaded images and the BS commands should work.

    I hope this helps.

Reply
  • Loading identical debug files is unfortunately not well supported. As you noticed, the fully qualified names are the same and when setting a BP in C the debugger puts it at the address of the first matching symbol name.

    As a workaround, in your µVision project that builds the app_position_independent.axf, you can add a User Command for "After Build" that creates a copy of the axf using Key Sequences like this:

    CMD /C "copy #L $L@L2.axf"

    which in this case creates a app_position_independent2.axf. On the second load use the app_position_independent2.axf. This gives different fully qualified symbols for the loaded images and the BS commands should work.

    I hope this helps.

Children