aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2016-09-27 13:07:11 +0200
committerMartin Liska <marxin@gcc.gnu.org>2016-09-27 11:07:11 +0000
commit8c9434c2f9358b8b8bad2c1990edf10a21645f9d (patch)
tree0dfe81cd421cbccec0f0b4ed0c7bdb2943ad2f00 /gcc/doc
parent511d092e41fcea25a4367dec16ea4b44d947f699 (diff)
downloadgcc-8c9434c2f9358b8b8bad2c1990edf10a21645f9d.zip
gcc-8c9434c2f9358b8b8bad2c1990edf10a21645f9d.tar.gz
gcc-8c9434c2f9358b8b8bad2c1990edf10a21645f9d.tar.bz2
gcov: dump in a static dtor instead of in an atexit handler
PR gcov-profile/7970 PR gcov-profile/16855 PR gcov-profile/44779 * g++.dg/gcov/pr16855.C: New test. * coverage.c (build_gcov_exit_decl): New function. (coverage_obj_init): Call the function and generate __gcov_exit destructor. * doc/gcov.texi: Document when __gcov_exit function is called. * libgcov-driver.c (__gcov_init): Do not register a atexit handler. (__gcov_exit): Rename from gcov_exit. * libgcov.h (__gcov_exit): Declare. From-SVN: r240529
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/gcov.texi4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/doc/gcov.texi b/gcc/doc/gcov.texi
index 1523cb1..1912f85 100644
--- a/gcc/doc/gcov.texi
+++ b/gcc/doc/gcov.texi
@@ -600,6 +600,10 @@ facilities to restrict profile collection to the program region of
interest. Calling @code{__gcov_reset(void)} will clear all profile counters
to zero, and calling @code{__gcov_dump(void)} will cause the profile information
collected at that point to be dumped to @file{.gcda} output files.
+Instrumented applications use a static destructor with priority 99
+to invoke the @code{__gcov_dump} function. Thus @code{__gcov_dump}
+is executed after all user defined static destructors,
+as well as handlers registered with @code{atexit}.
@c man end