Debugging the CoverageScanner API

Last edited on

To debug the functions provided by the CoverageScanner API it is necessary to:

  1. force CoverageScanner to keep the generated source file after compiling and linking. Therefore it is necessary to add --cs-keep-instrumentation-files to the compiler and linker command line arguments.

  2. compile the CoverageScanner library with debug information. Therefore it is necessary to add --cs-libgen=-g for GCC (or --cs-libgen=/Zi for Microsoft Visual Studio) to the linker command line option. Once the application is recompiled, it is possible to set a breakpoint in __coveragescanner_save() and step through the source code.