diff options
author | Qing Zhao <qing.zhao@oracle.com> | 2019-10-23 18:12:39 +0000 |
---|---|---|
committer | Qing Zhao <qinzhao@gcc.gnu.org> | 2019-10-23 18:12:39 +0000 |
commit | 9fdaaf77726f041c05b1e5cba428526c7cc69ad7 (patch) | |
tree | c49b669b88bf8da74b15fc4ae34b704a40204358 /gcc/coverage.c | |
parent | 6d188e4fddff68f4c50f8178104137f71d4c621e (diff) | |
download | gcc-9fdaaf77726f041c05b1e5cba428526c7cc69ad7.zip gcc-9fdaaf77726f041c05b1e5cba428526c7cc69ad7.tar.gz gcc-9fdaaf77726f041c05b1e5cba428526c7cc69ad7.tar.bz2 |
re PR gcov-profile/91971 (Profile directory concatenated with object file path)
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
Diffstat (limited to 'gcc/coverage.c')
-rw-r--r-- | gcc/coverage.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/coverage.c b/gcc/coverage.c index 0d5138f..bcba61c 100644 --- a/gcc/coverage.c +++ b/gcc/coverage.c @@ -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); |