This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430F67771A: Disassembly with interlist of C source

Part Number: MSP430F67771A


When running a live debug session, it's possible to view the disassembly with the C source interlisted. Is it possible to generate this outside of a debug session with compiler/assembly tools?

From the documentation, we're able to use the --optimizer_interlist and/or --c_src_interlist options with the compiler to generate assembly files with the original C source interlisted. We're also able to generate the disassembly from the final, linked binary using the disassembler (dis430.exe) to view the absolute addresses. It seems like there should be a way to combine these two processes to generate one comprehensive file.

  • It is a hard problem, especially with aggressive optimization, since the relevant assembly code may be out of order with the C code, or the C Code might not have any assembly equivalent at all.

  • With GCC I use objdump with the -S option to get things like:

    void __attribute__ ((wakeup, interrupt(TIMER0_A0_VECTOR))) Timer_A (void)
     {
       
       tick++;
        2120:       92 53 00 11     inc     &0x1100         ;
    
    00002124 <.Loc.56.1>:
     }
        2124:       b1 c0 f0 00     bic     #240,   0(r1)   ;#0x00f0
        2128:       00 00 
        212a:       00 13           reti                    
    
    

    Optimization  can make the correspondence between source and disassembly dodgy so you do have to be careful.

  • Yes, but in this case I simply want to combine the outputs of what is already provided by these tools/options, even if it is limited by optimizations. Right now, I'm able to generate the .asm files per object file and the disassembly of the final binary. If I view these all side-by-side, I essentially get what I'm looking for, but it's a pain having to manually match assembly language/C source from the .asm files with lines from the disassembly file to get their absolute addresses.

**Attention** This is a public forum