]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Add version to intermediate gcov file (PR gcov-profile/83669).
authorMartin Liska <mliska@suse.cz>
Thu, 4 Jan 2018 08:55:15 +0000 (09:55 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Thu, 4 Jan 2018 08:55:15 +0000 (08:55 +0000)
2018-01-04  Martin Liska  <mliska@suse.cz>

PR gcov-profile/83669
* gcov.c (output_intermediate_file): Add version to intermediate
gcov file.
* doc/gcov.texi: Document new field 'version' in intermediate
file format. Fix location of '-k' option of gcov command.

From-SVN: r256227

gcc/ChangeLog
gcc/doc/gcov.texi
gcc/gcov.c

index 007e2d5999f1c4198c0fb3c488de1e0ac3e669be..71ac19d67eec8780b276d7e631b1eca7bf2ef3b1 100644 (file)
@@ -1,3 +1,11 @@
+2018-01-04  Martin Liska  <mliska@suse.cz>
+
+       PR gcov-profile/83669
+       * gcov.c (output_intermediate_file): Add version to intermediate
+       gcov file.
+       * doc/gcov.texi: Document new field 'version' in intermediate
+       file format. Fix location of '-k' option of gcov command.
+
 2018-01-04  Martin Liska  <mliska@suse.cz>
 
        PR ipa/82352
index f37aa3ee05a2ef07187cdf5f4120ac0990c1eb9b..b55ee852ef9f1c68fc54d23722d8798b05b49f48 100644 (file)
@@ -187,11 +187,8 @@ be used by @command{lcov} or other tools. The output is a single
 The format of the intermediate @file{.gcov} file is plain text with
 one entry per line
 
-@item -j
-@itemx --human-readable
-Write counts in human readable format (like 24k).
-
 @smallexample
+version:@var{gcc_version}
 file:@var{source_file_name}
 function:@var{start_line_number},@var{end_line_number},@var{execution_count},@var{function_name}
 lcount:@var{line number},@var{execution_count},@var{has_unexecuted_block}
@@ -212,6 +209,7 @@ times.
 Here is a sample when @option{-i} is used in conjunction with @option{-b} option:
 
 @smallexample
+version: 8.1.0 20180103
 file:tmp.cpp
 function:7,7,0,_ZN3FooIcEC2Ev
 function:7,7,1,_ZN3FooIiEC2Ev
@@ -252,6 +250,10 @@ branch:35,nottaken
 lcount:36,1,0
 @end smallexample
 
+@item -j
+@itemx --human-readable
+Write counts in human readable format (like 24k).
+
 @item -k
 @itemx --use-colors
 
index 3b80f51e740a5b939003c8a9ced66e9c62028457..37f431c0e91b43cb5477da0c462b26f208a209e0 100644 (file)
@@ -1035,6 +1035,7 @@ file 'foo.cc.gcov' similar to the above example. */
 static void
 output_intermediate_file (FILE *gcov_file, source_info *src)
 {
+  fprintf (gcov_file, "version:%s\n", version_string);
   fprintf (gcov_file, "file:%s\n", src->name);    /* source file name */
 
   std::sort (src->functions.begin (), src->functions.end (),