As a child process uses the execvp()
call, an explicit dumping of the collected profile information is required.
Coverage:
-
on the master branch:
-
with this PR:
This PR mostly follows gcc/libgcc/libgcov-interface.c#L320-L332:
0/* A wrapper for the execvp function. Flushes the accumulated
1 profiling data, so that they are not lost. */
2
3
4int
5__gcov_execvp (const char *path, char *const argv[])
6{
7 /* Dump counters only, they will be lost after exec. */
8 __gcov_dump ();
9 int ret = execvp (path, argv);
10 /* We reach this code only when execv fails, reset counter then here. */
11 __gcov_reset ();
12 return ret;
13}