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.

Wrong Files are used for compalation.

Hello,

When using CCS (Version: 6.0.1.00040), I double click on a file in Project Explorer and edit it.  Then compile it, but the expected behavior change does not occur.  Then I start debugging, and CCS pulls up the old copy of the file without the change from somewhere.  This looks like a major bug to me, or extremely unintuitive behavior that wasted a day of my time so far.


I am using GIT for version control, but I handle version control from a command line terminal per our internal version control specifications.  This crazy behaviour may have something to do with GIT.  If so, how can I remove the knowledge of git from CCS so it does not get on our end.  We are extremely frustrated here, thanks for your help.

  • I still cannot figure this out, can someone help
  • Silver Diamond said:
    I double click on a file in Project Explorer and edit it.  Then compile it, but the expected behavior change does not occur. 

    Is it a C source file or a header file you are editing?

    It sounds like there is a mismatch between the file you are modifying and the one being pulled into the build/seen by the debugger. When the project is building, in the CCS build console, can you check the path shown for the particular source file and verify that it is compiling the correct one? If the file is linked to the project and not physically within the project directory, it will show the full path from where the file is being pulled. 

  • It is a C++ Source File, when I debug and pause, the debug pulls the following file:


    Notice #1 is the file path and #2 Line #84 is commented out.

    If I stop debugging and double click on the main.cpp, the following comes up.

    Notice the same path #1 but line #84, as shown at #2 is not commented out, so it is a different file.  When the file is rebuilt, there the build output is this:

    So then I add to one of the files the following line:

    // crazyness

    and run $grep -r "crazyness"

    I get the following result:

    /work/c1202-firmware$ grep -r "crazyness"
    c1202-f5336/main.cpp:	// crazyness
    

    Then I add the following line to the code of the other file:

        // CRAZYCARROT
    and run: $ grep -r "CRAZYCARROT"


    I get the following result:

    /work/c1202-firmware$ grep -r "CRAZYCARROT"
    c1202-f5336/main.cpp:		// CRAZYCARROT
    c1202-f5336-ccs-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/44/b073233b6ea60014119bff0063346c27:		// CRAZYCARROT
    c1202-f5336-ccs-workspace/.metadata/.plugins/org.eclipse.core.resources/.history/9e/80fc98db6da60014119bff0063346c27:    	// CRAZYCARROT
    

    So why does CCS use .history file instead of the actual source, and how do I stop it?

  • Found the answer.

    I you right click on the file, there is a "Replace With>Local History" menu. I must have accidentally done that. So I took it back to "Replace With>Branch Tag Or Reference", then selecteed "Local>Master" and now it works.
  • I was just going to reply to your earlier post about the .history folder. When changes are made to a source file, the previous version of the file is saved in that folder to allow for things like viewing Local History and reverting back to an older version of the file from the Local History. Looks like you beat me to it though and found that to be reason for your issue.  

    Thank you for the update and glad you found the reason for the mismatch.