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.

CCS/TM4C129XNCZAD: Weird disassembler behavior in debugger

Part Number: TM4C129XNCZAD


Tool/software: Code Composer Studio

Hello, I am currently trying to port matrixSSL to the TIARM-compiler (which is a challenge, as most performance boosts for the GNU-compiler come from __asm__ statements, which don't work). When debugging some of the code, the disassembler shows some weird output (the software works, but the output looks strange). The asm-file shows:

    .dwcfi    cfa_offset, 0
        PUSH      {A4, V1, V2, V3, V4, LR} ; [DPU_V7M3_PIPE]
    .dwcfi    cfa_offset, 24
    .dwcfi    save_reg_to_mem, 14, -4
    .dwcfi    save_reg_to_mem, 7, -8
    .dwcfi    save_reg_to_mem, 6, -12
    .dwcfi    save_reg_to_mem, 5, -16
    .dwcfi    save_reg_to_mem, 4, -20
    .dwcfi    save_reg_to_mem, 3, -24
        MOV       V4, A1                ; [DPU_V7M3_PIPE] |1251|
        MOV       V1, A4                ; [DPU_V7M3_PIPE] |1251|
        MOV       V3, A2                ; [DPU_V7M3_PIPE] |1251|
    .dwpsn    file "D:/.../matrixssl-4-2-1/crypto/math/pstmnt.c",line 1259,column 5,is_stmt,isa 1
;----------------------------------------------------------------------
; 1259 | carry -= pstmnt_sub_mask(p, r, n, -(pstmnt_word) 1);                   
;----------------------------------------------------------------------
        MOV       A1, A2                ; [DPU_V7M3_PIPE] |1259|
    .dwpsn    file "D:/.../matrixssl-4-2-1/crypto/math/pstmnt.c",line 1251,column 1,is_stmt,isa 1
        MOV       V2, A3                ; [DPU_V7M3_PIPE] |1251|

    .dwpsn    file "D:/.../matrixssl-4-2-1/crypto/math/pstmnt.c",line 1259,column 5,is_stmt,isa 1
        MOV       A4, #-1               ; [DPU_V7M3_PIPE] |1259|

If I look at the same sequence in the debugger, it shows the following:

          pstmnt_cmp_sub_mod_carry():
0004a418:   B5F8                push       {r3, r4, r5, r6, r7, lr}
0004a419:   07B5               .word       0x000007b5
0004a41b:   1C46               .word       0x00001c46
0004a41d:   0E46               .word       0x00000e46
0004a41f:   0846               .word       0x00000846
1259          carry -= pstmnt_sub_mask(p, r, n, -(pstmnt_word) 1);
0004a420:   4608                mov        r0, r1
1251      {
0004a422:   4615                mov        r5, r2

1251      {
.........   4F46               .word       0x00004f46

First of all, push is a 16bit-command. So the address increment of 1 is already wrong. In 0x4a420 it is resynced, but later it even doesn't show an address.

Is it a wrong setting or a disassembler bug? I don't know which component versions are interesting and the complete list is quite long. Here are some:

Code Composer Studio Base Components 8.3.0.01611

Code Composer Studio IDE ARM Components 8.3.0.201810301800

Debug Server 8.3.0.1611

Tiva C Series ARM MCUs 2.1.1.15071

 

Regards

Klaus

 

  • Klaus,

    From your description it sounds like the code is executing correctly (ie) the correct instructions are executed, but the disassembly view is displaying them incorrectly. If that is the case my first suggestion would be to give a try with the latest version of CCS 9.1.0. It may be a bug that has already been addressed in newer versions.

    In CCS 9.1.0, as a first step you can simply load your current executable (without rebuilding the entire project) using a manual debugger launch. Then verify if the issue still exists. If it does please send us a small test case to help us reproduce the issue. 

  • Hello,

    thanks for the quick answer. I fear, it was a "spurious" effect. After restarting CCS I could not even reproduce it with the current version of my CCS. I continue to reproduce, at least I know how it happened: The application was in an endless loop, I pressed the "suspend" button and I was there. But at least it is not an "always"-bug as around 20 attempts didn't reproduce it. When I posted my message, it happened twice at 2 attempts.

  • Thank you for reporting back. We will close out this thread for now but if the issue reappears consistently please feel free to reopen the thread or create a new one.