On Fri, Jul 15, 2011 at 12:15:48PM -0600, Tom Tromey wrote: > >>>>> "Jakub" == Jakub Jelinek <ja...@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