Page MenuHomePhabricator

[DebugInfo] Allow GNU macro extension to be read

Authored by dstenb on Jul 1 2020, 8:53 AM.



Allow the GNU .debug_macro extension to be parsed and printed by
llvm-dwarfdump. In an upcoming patch support will be added for emitting
that format also.

Diff Detail

Event Timeline

dstenb created this revision.Jul 1 2020, 8:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 1 2020, 8:53 AM
dblaikie accepted this revision.Jul 1 2020, 1:37 PM
dblaikie added inline comments.
3055–3059 ↗(On Diff #274832)

I'd probably inline the lambda into the call expression - it's short/simple enough.

535 ↗(On Diff #274832)

Probably llvm::function_ref here, since the functor doesn't escape the callee

This revision is now accepted and ready to land.Jul 1 2020, 1:37 PM
ikudrin added inline comments.Jul 2 2020, 12:10 AM

If this is written like

<< (Macros.Header.Version < 5 ? GnuMacroString(E.type) : MacroString(E.type)) ;

then llvm::dwarf::MacroString() can be left as is and most of the changes are not needed.

dstenb updated this revision to Diff 275749.Jul 6 2020, 9:56 AM
dstenb marked 3 inline comments as done.

Address comments.

3055–3059 ↗(On Diff #274832)

This change is now removed. I'll inline the expression in the follow-up patch.

535 ↗(On Diff #274832)

Yes, thanks! Since I moved out the GNU defines to a separate GnuMacroString() function this change is done in the patch which introduces emission of the extension.


Yes, thanks! Since there are so few uses where we conditionally want to select either the DWARF or GNU defines that seems cleaner.

This revision was automatically updated to reflect the committed changes.