Recognize .debug_macro/DW_AT_GNU_macros

Mark Wielaard mjw at redhat.com
Tue Jun 26 10:13:44 UTC 2012


Hi,

This adds minimal low-level support for .debug_macro/DW_AT_GNU_macros as
proposed here http://www.dwarfstd.org/ShowIssue.php?issue=110722.1 and
implemented in gcc 4.7 (-g3). It is just enough to not barf on it when
we encounter the new attribute and to sanity check the attribute form
offsets. I added two small testfiles one using .debug_macinfo and one
using the new .debug_macros.

I haven't yet added the new DW_MACRO values to interpret the actual
contents. We might not even want/need to if gor higher-level support we
just reuse the DW_MACINFO values with the dwarf_getmacros (),
dwarf_macro_opcode (), dwarf_macro_param1 () and dwarf_macro_param2 ()
interface.

The new define/undef and start_file/end_file opcodes encode the same
information (and use the same values). There is no vendor_ext. There are
three new opcodes define_indirect, undef_indirect and
transparent_include. The first two are identical to define/undef, but
take their arguments differently. And transparent_include makes it
possible to reuse opcodes from somewhere else in the section. These
seems to be just the kind of thing that our interface wants to hide from
the user. So we would just return the original DW_MACINFO_define opcode
numbers and provide the param1/2 as we do now (just fetch them from
different places). Does that sound like a plan?

Cheers,

Mark
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-low-level-support-for-.debug_macro.patch
Type: text/x-patch
Size: 28255 bytes
Desc: not available
URL: <https://fedorahosted.org/pipermail/elfutils-devel/attachments/20120626/94f7afc1/attachment-0001.bin>


More information about the elfutils-devel mailing list