How to force gcov to extract data, even when program is aborted
问题 I'm using a test-generating tool called KLEE, that creates lots of tests for my C99-Code. Afterwards I run the tests and check line coverage with gcov. Gcov seems to update coverage data at the end of the run upon successful completion. However, some tests fail (assert statements that are not true), which leads to aborting the program and gcov not counting the lines covered in this run. Is there any way that gcov flushes information on any exit (not only on successful)? 回答1: Call void __gcov