diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2003-07-06 14:51:48 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2003-07-06 14:51:48 +0000 |
commit | dd486eb27ce3fc75e02311d3e36d9e10a9f56eee (patch) | |
tree | a94f984308aa02ce879de7afc0672f6a1d92a100 /gcc/gcov.c | |
parent | c07e547752171cafffdbae0c46f90251d266141b (diff) | |
download | gcc-dd486eb27ce3fc75e02311d3e36d9e10a9f56eee.zip gcc-dd486eb27ce3fc75e02311d3e36d9e10a9f56eee.tar.gz gcc-dd486eb27ce3fc75e02311d3e36d9e10a9f56eee.tar.bz2 |
gcov-io.h: Add a local time stamp.
* gcov-io.h: Add a local time stamp.
(struct gcov_info): Add stamp field.
(gcov_truncate): New.
* coverage.c (read_counts_file): Skip the stamp.
(coverage_begin_output): Write the stamp.
(build_gcov_info): Declare and init the stamp.
(coverage_finish): Only unlink data file, if stamp is zero.
* gcov-dump.c (dump_file): Dump the stamp.
* gcov.c (bbg_stamp): New.
(release_structures): Clear bbg_stamp.
(read_graph_file): Read stamp.
(read_count_file): Check stamp.
* libgcov.c (gcov_exit): Check stamp and truncate if needed.
From-SVN: r69006
Diffstat (limited to 'gcc/gcov.c')
-rw-r--r-- | gcc/gcov.c | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -269,6 +269,9 @@ static time_t bbg_file_time; static char *bbg_file_name; +/* Stamp of the bbg file */ +static unsigned bbg_stamp; + /* Name and file pointer of the input file for the arc count data. */ static char *da_file_name; @@ -583,6 +586,7 @@ release_structures () free (da_file_name); da_file_name = bbg_file_name = NULL; bbg_file_time = 0; + bbg_stamp = 0; while ((src = sources)) { @@ -740,7 +744,8 @@ read_graph_file () fnotice (stderr, "%s:version `%.4s', prefer `%.4s'\n", bbg_file_name, v, e); } - + bbg_stamp = gcov_read_unsigned (); + while ((tag = gcov_read_unsigned ())) { unsigned length = gcov_read_unsigned (); @@ -1008,6 +1013,12 @@ read_count_file () fnotice (stderr, "%s:version `%.4s', prefer version `%.4s'\n", da_file_name, v, e); } + tag = gcov_read_unsigned (); + if (tag != bbg_stamp) + { + fnotice (stderr, "%s:stamp mismatch with graph file\n", da_file_name); + goto cleanup; + } while ((tag = gcov_read_unsigned ())) { |