On Wed, Jan 1, 2025 at 1:44 AM Fangrui Song <mask...@gcc.gnu.org> wrote:
>
> so that
> `gcc -c a.cc --coverage -fprofile-prefix-map=$PWD=.`
> does not emit $PWD in the generated a.gcno file.

This looks OK to me.  Please leave a few days for others to comment though.

Thanks,
Richard.

>         PR gcov-profile/96092
> ---
>  gcc/coverage.cc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gcc/coverage.cc b/gcc/coverage.cc
> index 1ed55fed547..c6e9aced6fe 100644
> --- a/gcc/coverage.cc
> +++ b/gcc/coverage.cc
> @@ -1341,7 +1341,7 @@ coverage_init (const char *filename)
>           gcov_write_unsigned (bbg_file_stamp);
>           /* Use an arbitrary checksum */
>           gcov_write_unsigned (0);
> -         gcov_write_string (getpwd ());
> +         gcov_write_string (remap_profile_filename (getpwd ()));
>
>           /* Do not support has_unexecuted_blocks for Ada.  */
>           gcov_write_unsigned (strcmp (lang_hooks.name, "GNU Ada") != 0);
> --
> 2.47.1
>

Reply via email to