How do the code coverage options of GCC work?
问题 Consider the following command: gcc -fprofile-arcs -ftest-coverage main.c It generates the file, main.gcda, which is to be used by gcov, to generate the coverage analysis. So how does main.gcda is generated? How the instrumentation is done? Can I see the instrumented code? 回答1: .gcda is not generated by compiler; it's generated by your program when you execute it. .gcno is the file generated at compilation time and it is the 'note file'. gcc generate a basic block graph notes file (.gcno) for