+2017-04-18 Martin Liska <mliska@suse.cz>
+
+ PR gcov-profile/78783
+ * gcov-tool.c (gcov_output_files): Validate that destination
+ file is either removed by the tool or by a user.
+
2017-04-14 Andrew Burgess <andrew.burgess@embecosm.com>
Guy Benyei <guybe@mellanox.com>
extern int gcov_profile_scale (struct gcov_info*, float, int, int);
extern struct gcov_info* gcov_read_profile_dir (const char*, int);
extern void gcov_do_dump (struct gcov_info *, int);
+extern const char *gcov_get_filename (struct gcov_info *list);
extern void gcov_set_verbose (void);
/* Set to verbose output mode. */
if (ret)
fatal_error (input_location, "Cannot change directory to %s", out);
+ /* Verify that output file does not exist (either was removed by
+ unlink_profile_data or removed by user). */
+ const char *filename = gcov_get_filename (profile);
+
+ if (access (filename, F_OK) != -1)
+ fatal_error (input_location, "output file %s already exists in folder %s",
+ filename, out);
+
gcov_do_dump (profile, 0);
ret = chdir (pwd);
+2017-04-18 Martin Liska <mliska@suse.cz>
+
+ PR gcov-profile/78783
+ * libgcov-driver.c (gcov_get_filename): New function.
+
2017-04-07 Jeff Law <law@redhat.com>
* Makefile.in: Swap definition of LIBGCC_LINKS and inclusion of
free (gf.filename);
}
+#if IN_GCOV_TOOL
+const char *
+__attribute__ ((unused))
+gcov_get_filename (struct gcov_info *list)
+{
+ return list->filename;
+}
+#endif
+
#if !IN_GCOV_TOOL
void
__gcov_dump_one (struct gcov_root *root)