Program Changes
With the small example from the basic tutorial, we describe the workflow with Testwell CTC++ when the code is changed.
ctc -i m cl /c io.c
ctc cl prime.obj io.obj calc.obj
The first command line instruments and compiles the io.c file and leaves the result in the io.obj file. No linking takes place, because the '/c' options prevents it.
The second command line makes the linking. cl command is used as it can also be used for linking. On the command line there are no C or C++ source files and thus no instrumentation takes place there. However, there is one thing ctc does: it adds the Testwell CTC++ run-time library to the linking command that is finally executed. Here it is not necessary, but possible and having no effect, to give the -i option to ctc as there are no source files to be instrumented.
ctcpost MON.sym MON.dat -p profile.txt
When we now look at the profile.txt execution profile listing, we notice that the counters for file io.c correspond only to the test run just executed. The counters for files prime.c and calc.c correspond cumulatively to all test runs. Because the code in io.c was changed and file reinstrumented its previous counters became obsolete and were left out (actually, here, overwritten in the file MON.dat).