diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2022-03-30 21:45:23 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2022-04-28 20:46:49 +0200 |
commit | 39d80300b3c769c3a7805a46ee5facc6adf1a4d0 (patch) | |
tree | 2c8609ca844a90b8006e39f11c2735a91fe73dff /gcc/doc | |
parent | 68a4673fe25e067df74373a45180d80c70da102f (diff) | |
download | gcc-39d80300b3c769c3a7805a46ee5facc6adf1a4d0.zip gcc-39d80300b3c769c3a7805a46ee5facc6adf1a4d0.tar.gz gcc-39d80300b3c769c3a7805a46ee5facc6adf1a4d0.tar.bz2 |
gcov: Add __gcov_filename_to_gcfn()
gcc/
* doc/invoke.texi (fprofile-info-section): Mention
__gcov_filename_to_gcfn(). Use "freestanding" to match with C11
standard language. Fix minor example code issues.
* gcov-io.h (GCOV_FILENAME_MAGIC): Define and document.
gcc/testsuite/
* gcc.dg/gcov-info-to-gcda.c: Test __gcov_filename_to_gcfn().
libgcc/
* gcov.h (__gcov_info_to_gcda): Mention __gcov_filename_to_gcfn().
(__gcov_filename_to_gcfn): Declare and document.
* libgcov-driver.c (dump_string): New.
(__gcov_filename_to_gcfn): Likewise.
(__gcov_info_to_gcda): Adjust comment to match C11 standard language.
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/invoke.texi | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index b2d2cea..7cff38b 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -15462,7 +15462,7 @@ profile information generated by @option{-fprofile-arcs} is placed in the specified section for each translation unit. This option disables the profile information registration through a constructor and it disables the profile information processing through a destructor. This option is not intended to be -used in hosted environments such as GNU/Linux. It targets free-standing +used in hosted environments such as GNU/Linux. It targets freestanding environments (for example embedded systems) with limited resources which do not support constructors/destructors or the C library file I/O. @@ -15487,14 +15487,8 @@ for example like this: #include <stdio.h> #include <stdlib.h> -extern const struct gcov_info *__gcov_info_start[]; -extern const struct gcov_info *__gcov_info_end[]; - -static void -filename (const char *f, void *arg) -@{ - puts (f); -@} +extern const struct gcov_info *const __gcov_info_start[]; +extern const struct gcov_info *const __gcov_info_end[]; static void dump (const void *d, unsigned n, void *arg) @@ -15505,6 +15499,12 @@ dump (const void *d, unsigned n, void *arg) printf ("%02x", c[i]); @} +static void +filename (const char *f, void *arg) +@{ + __gcov_filename_to_gcfn (f, dump, arg ); +@} + static void * allocate (unsigned length, void *arg) @{ @@ -15514,8 +15514,8 @@ allocate (unsigned length, void *arg) static void dump_gcov_info (void) @{ - const struct gcov_info **info = __gcov_info_start; - const struct gcov_info **end = __gcov_info_end; + const struct gcov_info *const *info = __gcov_info_start; + const struct gcov_info *const *end = __gcov_info_end; /* Obfuscate variable to prevent compiler optimizations. */ __asm__ ("" : "+r" (info)); @@ -15530,9 +15530,9 @@ dump_gcov_info (void) @} int -main() +main (void) @{ - dump_gcov_info(); + dump_gcov_info (); return 0; @} @end smallexample |