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.

Section of code not compiled. Breakpoints can't be set where the code is missing.

Other Parts Discussed in Thread: MSP430FR5739

I'm experiencing bizarre behavior of Code Composer Studio  (Version: 5.5.0.00077),  a section of code that I've debugged and which was working a day ago has suddenly disappeared. You can see the problem if you look at this screenshot...

I have optimization at the lowest level.  All the code between line 676 and line 743 is missing, which you can see on the right disassembly pane.  If I click on any line of code on the left to create a breakpoint, the breakpoint is created on line 743.  For example I double clicked on line 698 and the breakpoint appeared on line 743.  Here is a screenshot afterwards:

I've tried all sorts of things to fix this like moving code around, clean rebuilds, adding extra lines, moving the code location in FRAM memory (I'm using an MSP430FR5739).  Nothing has an effect.  It is always the same section of code that is missing even if there is extra code before it or I change its location in FRAM.  I'm stumped.

Any help would be greatly appreciated.

  • Hi Samuel,

    what if you disable optimization?  Can you verify the settings?  Also, would you be willing to share the project (or a cut down example demonstrating this) with us offline?

    Best Regards,
    Lisa

  • I had optimization at level 0, but I changed it to off, and now it seems to create the missing code.  I'm still baffled by this, because I had no problem with this specific routine previously, and had been working on a different section when this problem arose.

  • Hi Samuel,

    the compiler team could possibly explain better how optimization works, and it likely gets improved and/or tweaked over compiler versions.

    However, it does not surprise me that with optimization at all on, there is code being optimized out.

    Best Regards,

    Lisa

  • It is now making sense to me.  I was misunderstanding what an optimization level of 0 was, thinking that this meant that it was off.  Along with that I had somehow dropped a 0 from a bit mask in a conditional that caused the optimization to conclude that the code would never get passed that conditional.  The combination had me stumped.  But now that I know that the 0 does not mean off, everything is good.  Thanks for your help. 

  • Hi Samuel,

    glad to hear you are clearer now.  That's what we're here for.

    All the best with development.

    Best Regards,

    Lisa