* [PATCH] fix -fdebug-prefix-map without gas .file support
@ 2020-02-21 10:02 Richard Biener
2020-02-26 5:04 ` Jason Merrill
0 siblings, 1 reply; 3+ messages in thread
From: Richard Biener @ 2020-02-21 10:02 UTC (permalink / raw)
To: gcc-patches; +Cc: mwilliams, jason
This applies file mapping when emitting the directory table
directly instead of using the assemblers .file directive where
we already correctly apply the map. Notably the non-assembler
path is used for the early debug emission for LTO.
Bootstrapped and tested on x86_64-unknown-linux-gnu.
OK for trunk?
Thanks,
Richard.
2020-02-21 Mark Williams <mwilliams@fb.com>
* dwarf2out.c (file_name_acquire): Call remap_debug_filename.
---
gcc/dwarf2out.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 577be3d52d3..ba9da0f2cc2 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -12205,8 +12205,9 @@ file_name_acquire (dwarf_file_data **slot, file_name_acquire_data *fnad)
fi = fnad->files + fnad->used_files++;
+ f = remap_debug_filename (d->filename);
+
/* Skip all leading "./". */
- f = d->filename;
while (f[0] == '.' && IS_DIR_SEPARATOR (f[1]))
f += 2;
--
2.16.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fix -fdebug-prefix-map without gas .file support
2020-02-21 10:02 [PATCH] fix -fdebug-prefix-map without gas .file support Richard Biener
@ 2020-02-26 5:04 ` Jason Merrill
2020-02-27 10:46 ` Richard Biener
0 siblings, 1 reply; 3+ messages in thread
From: Jason Merrill @ 2020-02-26 5:04 UTC (permalink / raw)
To: Richard Biener, gcc-patches; +Cc: mwilliams
On 2/21/20 5:02 AM, Richard Biener wrote:
> This applies file mapping when emitting the directory table
> directly instead of using the assemblers .file directive where
> we already correctly apply the map. Notably the non-assembler
> path is used for the early debug emission for LTO.
>
> Bootstrapped and tested on x86_64-unknown-linux-gnu.
>
> OK for trunk?
OK.
> Thanks,
> Richard.
>
> 2020-02-21 Mark Williams <mwilliams@fb.com>
>
> * dwarf2out.c (file_name_acquire): Call remap_debug_filename.
> ---
> gcc/dwarf2out.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
> index 577be3d52d3..ba9da0f2cc2 100644
> --- a/gcc/dwarf2out.c
> +++ b/gcc/dwarf2out.c
> @@ -12205,8 +12205,9 @@ file_name_acquire (dwarf_file_data **slot, file_name_acquire_data *fnad)
>
> fi = fnad->files + fnad->used_files++;
>
> + f = remap_debug_filename (d->filename);
> +
> /* Skip all leading "./". */
> - f = d->filename;
> while (f[0] == '.' && IS_DIR_SEPARATOR (f[1]))
> f += 2;
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fix -fdebug-prefix-map without gas .file support
2020-02-26 5:04 ` Jason Merrill
@ 2020-02-27 10:46 ` Richard Biener
0 siblings, 0 replies; 3+ messages in thread
From: Richard Biener @ 2020-02-27 10:46 UTC (permalink / raw)
To: Jason Merrill; +Cc: gcc-patches, mwilliams
On Wed, 26 Feb 2020, Jason Merrill wrote:
> On 2/21/20 5:02 AM, Richard Biener wrote:
> > This applies file mapping when emitting the directory table
> > directly instead of using the assemblers .file directive where
> > we already correctly apply the map. Notably the non-assembler
> > path is used for the early debug emission for LTO.
> >
> > Bootstrapped and tested on x86_64-unknown-linux-gnu.
> >
> > OK for trunk?
>
> OK.
I've pushed this variant which makes sure to apply -fdebug-prefix-map
and friends consistently for LTO in locations as well.
Bootstrapped / tested on x86_64-unknown-linux-gnu.
Richard.
2020-02-26 Mark Williams <mwilliams@fb.com>
* dwarf2out.c (file_name_acquire): Call remap_debug_filename.
* lto-opts.c (lto_write_options): Drop -fdebug-prefix-map,
-ffile-prefix-map and -fmacro-prefix-map.
* lto-streamer-out.c: Include file-prefix-map.h.
(lto_output_location): Remap the file part of locations.
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 8da1ad053f6..38b16add568 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -12205,8 +12205,9 @@ file_name_acquire (dwarf_file_data **slot, file_name_acquire_data *fnad)
fi = fnad->files + fnad->used_files++;
+ f = remap_debug_filename (d->filename);
+
/* Skip all leading "./". */
- f = d->filename;
while (f[0] == '.' && IS_DIR_SEPARATOR (f[1]))
f += 2;
diff --git a/gcc/lto-opts.c b/gcc/lto-opts.c
index 87e916a2741..2512560cc6d 100644
--- a/gcc/lto-opts.c
+++ b/gcc/lto-opts.c
@@ -131,6 +131,9 @@ lto_write_options (void)
case OPT_SPECIAL_input_file:
case OPT_dumpdir:
case OPT_fresolution_:
+ case OPT_fdebug_prefix_map_:
+ case OPT_ffile_prefix_map_:
+ case OPT_fmacro_prefix_map_:
continue;
default:
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index 1faf31c0551..cea5e71cffb 100644
--- a/gcc/lto-streamer-out.c
+++ b/gcc/lto-streamer-out.c
@@ -44,6 +44,7 @@ along with GCC; see the file COPYING3. If not see
#include "omp-offload.h"
#include "print-tree.h"
#include "tree-dfa.h"
+#include "file-prefix-map.h" /* remap_debug_filename() */
static void lto_write_tree (struct output_block*, tree, bool);
@@ -200,7 +201,7 @@ lto_output_location (struct output_block *ob, struct bitpack_d *bp,
if (ob->current_file != xloc.file)
{
- bp_pack_string (ob, bp, xloc.file, true);
+ bp_pack_string (ob, bp, remap_debug_filename (xloc.file), true);
bp_pack_value (bp, xloc.sysp, 1);
}
ob->current_file = xloc.file;
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-02-27 10:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-21 10:02 [PATCH] fix -fdebug-prefix-map without gas .file support Richard Biener
2020-02-26 5:04 ` Jason Merrill
2020-02-27 10:46 ` Richard Biener
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).