+ if (!fstat (fileno (source_file), &status)
+ && status.st_mtime > bbg_file_time)
+ {
+ fnotice (stderr, "%s:source file is newer than graph file '%s'\n",
+ src->name, bbg_file_name);
+ fprintf (gcov_file, "%9s:%5d:Source is newer than graph\n",
+ "-", 0);
+ }
+ }
+
+ if (flag_branches)
+ fn = src->functions;
+
+ for (line_num = 1, line = &src->lines[line_num];
+ line_num < src->num_lines; line_num++, line++)
+ {
+ for (; fn && fn->line == line_num; fn = fn->line_next)
+ {
+ arc_t *arc = fn->blocks[fn->num_blocks - 1].pred;
+ gcov_type return_count = fn->blocks[fn->num_blocks - 1].count;
+
+ for (; arc; arc = arc->pred_next)
+ if (arc->fake)
+ return_count -= arc->count;
+
+ fprintf (gcov_file, "function %s", fn->name);
+ fprintf (gcov_file, " called %s",
+ format_gcov (fn->blocks[0].count, 0, -1));
+ fprintf (gcov_file, " returned %s",
+ format_gcov (return_count, fn->blocks[0].count, 0));
+ fprintf (gcov_file, " blocks executed %s",
+ format_gcov (fn->blocks_executed, fn->num_blocks - 2, 0));
+ fprintf (gcov_file, "\n");
+ }
+
+ /* For lines which don't exist in the .bb file, print '-' before
+ the source line. For lines which exist but were never
+ executed, print '#####' before the source line. Otherwise,
+ print the execution count before the source line. There are
+ 16 spaces of indentation added before the source line so that
+ tabs won't be messed up. */
+ fprintf (gcov_file, "%9s:%5u:",
+ !line->exists ? "-" : !line->count ? "#####"
+ : format_gcov (line->count, 0, -1), line_num);
+
+ if (retval)
+ {
+ /* Copy source line. */
+ do
+ {
+ retval = fgets (string, STRING_SIZE, source_file);
+ if (!retval)
+ break;
+ fputs (retval, gcov_file);
+ }
+ while (!retval[0] || retval[strlen (retval) - 1] != '\n');