This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] More compact (100x) -g3 .debug_macinfo (take 2)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Jason Merrill <jason at redhat dot com>, Richard Henderson <rth at redhat dot com>, Jan Kratochvil <jkratoch at redhat dot com>, Roland McGrath <roland at redhat dot com>, Cary Coutant <ccoutant at google dot com>, Mark Wielaard <mjw at redhat dot com>
- Date: Fri, 15 Jul 2011 20:27:07 +0200
- Subject: Re: [RFC] More compact (100x) -g3 .debug_macinfo (take 2)
- References: <20110713170053.GX2687@tyan-ft48-01.lab.bos.redhat.com> <20110715154223.GM2687@tyan-ft48-01.lab.bos.redhat.com> <m3hb6nbeaz.fsf@fleche.redhat.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Jul 15, 2011 at 12:15:48PM -0600, Tom Tromey wrote:
> >>>>> "Jakub" == Jakub Jelinek <jakub@redhat.com> writes:
>
> Jakub> The patch below implements that slight change, in particular the
> Jakub> "4" suffixes from the op names were dropped,
> Jakub> DW_MACINFO_GNU_*_indirect have DW_FORM_udata and DW_FORM_strp
> Jakub> arguments now (i.e. DWARF_OFFSET_SIZE large) and
> Jakub> DW_MACINFO_GNU_transparent_include has DW_FORM_sec_offset
> Jakub> argument (i.e. again 4 bytes long for 32-bit DWARF and 8 bytes
> Jakub> long for 64-bit DWARF). GCC assures that no merging will happen
> Jakub> between .debug_macinfo chunks with 32-bit and 64-bit DWARF by
> Jakub> adding the byte size in the comdat GROUP name. I think that's
> Jakub> cleaner than hardcoding 4 bytes and not optimizing anything on
> Jakub> MIPS.
>
> The .debug_macinfo section doesn't have any header describing its
> contents. How would a consumer know which offset size to use?
The same way as it knows how to interpret the second operands of
DW_MACINFO_start_file. They aren't meaningful without knowing what
.debug_line section they refer to. For .debug_line, you need to remember
DW_AT_stmt_list of the CU that refers to the .debug_macinfo section
through DW_AT_macro_info, and you'd remember whether the referencing
CU is 32-bit DWARF or 64-bit DWARF. And the producer would need to arange
that DW_MACINFO_GNU_transparent_include referenced chunks have the same
properties (i.e. same offset size, and, if they use DW_MACINFO_start_file,
also the same .debug_line).
Jakub