re PR gcov-profile/91971 (Profile directory concatenated with object file path)
authorQing Zhao <qing.zhao@oracle.com>
Wed, 23 Oct 2019 18:12:39 +0000 (18:12 +0000)
committerQing Zhao <qinzhao@gcc.gnu.org>
Wed, 23 Oct 2019 18:12:39 +0000 (18:12 +0000)
2019-10-23  qing zhao  <qing.zhao@oracle.com>

PR gcov-profile/91971
* coverage.c (coverage_init): Mangle the full path of filename when
filename is a absolute path.

From-SVN: r277344

gcc/ChangeLog
gcc/coverage.c

index 7dc6885399ccca7bdf4f9d404454dea635d3a3fb..e1a4213ddddffb266fdbf839a4cf8cbe27085f79 100644 (file)
@@ -1,3 +1,9 @@
+2019-10-23  qing zhao  <qing.zhao@oracle.com>
+
+       PR gcov-profile/91971
+       * coverage.c (coverage_init): Mangle the full path of filename when
+       filename is a absolute path.
+
 2019-10-23  Jozef Lawrynowicz  <jozef.l@mittosystems.com>
 
        * config/msp430/msp430-protos.h (msp430_has_hwmult): New.
index 0d5138feb2b4f65c4951daf1cbbbd19b5df6986e..bcba61c9a9affbed6aca79e63bcfaafcdd7418ba 100644 (file)
@@ -1229,6 +1229,14 @@ coverage_init (const char *filename)
       else
        profile_data_prefix = getpwd ();
     }
+  else
+    {
+      /* when filename is a absolute path, we also need to mangle the full
+      path of filename to prevent the profiling data being stored into a
+      different path than that specified by profile_data_prefix.  */
+      filename = mangle_path (filename);
+      len = strlen (filename);
+    }
 
   if (profile_data_prefix)
     prefix_len = strlen (profile_data_prefix);