How Do I Link Back To Source Code?


Linking ARM Source Code to TLA Disassembly

The Elf/Dwarf2 format generated by the ARM tools is supported only in TLA versions 4.0 (or greater).

1) Compile your ARM application so that symbol and source line number information is saved in the .axf executable image. In Metroworks, to do this, make sure you are compiling a Debug or DebugRel version (which will set the -g option for compilation). Then select the Edit-> Settings menu option, and click on Language Settings. For the ARM Assembler, click on the Options tab and click on Source Line Debug. For each compiler you use (ARM C, Thumb C, etc.) click on the Debug/Opt Tab and check the Enable debug table generation (this step may not be necessary).

2) Compile and run your application in the debugger. In the TLA, load the bus support package and capture a listing trace.

3) Make sure that you set the path to your source files. Go to System-> Options and select the Sources files tab. Add the appropriate search path to your sources files.

4) Set up source window:
a) Select the Window->New Data Window menu option,
b) Select Source window,
c) Click next
d) Choose to base it on an existing listing window,
e) Click next
f) Normally you can leave the defaults for the listing window, data source, and listing column (but change them as appropriate)
g) Click on Symbol file button and browse & select .axf file
h) Click next
i) Name window
j) Click next and source window appears.

5) If a message appears in the source window that it can't find a matching line number, click the right arrow button a few times (next line). Sometimes a listing trace, if not triggered on a specific instruction address, can begin on an invalid instruction address.

6) If the TLA still can't match an address, then you should verify that the disassembly addresses in the listing window actually match addresses in the ARM debugger. Once possible case where they might not is if you are using the ARM-EBI bus support package, which allows the user to specify base address offsets for each of its chip selects. Thus, if these base address offsets are not set correctly, the listing addresses will not match the symbol table addresses. In this case, correct the base address offsets, and rerun the trace.