This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] suppress weird gcov filename handling
- From: Tristan Gingold <gingold at adacore dot com>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 20 Aug 2008 16:52:00 +0200
- Subject: [PATCH] suppress weird gcov filename handling
Hi,
currently if gcov is invoked like:
$ gcov path/to/file.gcda
it will try to open file.gcda and file.gcno instead of path/to/file.
{gcda,gcno}.
This is slightly annoying as you can't use easily gcov with wilcard, eg:
$ gcov dir1/*.gcda dir2/*.gcda
This patch changes current gcov behaviour: full filenames are used
instead of basenames.
(the old behaviour was not documented in the user manual).
Reg-tested on x86-64 linux.
Tristan.
2008-08-20 Tristan Gingold <gingold@adacore.com>
* gcov.c (create_file_names): If no object directory is specified,
keep directories of file_name.
--- gcc/gcov.c (revision 139223)
+++ gcc/gcov.c (working copy)
@@ -625,7 +628,7 @@
/* Generate the names of the graph and data files. If OBJECT_DIRECTORY
is not specified, these are looked for in the current directory,
- and named from the basename of the FILE_NAME sans extension. If
+ and named from the FILE_NAME sans extension. If
OBJECT_DIRECTORY is specified and is a directory, the files are in
that directory, but named from the basename of the FILE_NAME, sans
extension. Otherwise OBJECT_DIRECTORY is taken to be the name of
@@ -664,8 +667,8 @@
else
{
name = XNEWVEC (char, length + 1);
- name[0] = 0;
- base = 1;
+ strcpy (name, file_name);
+ base = 0;
}
if (base)