This is an archive of the discontinued LLVM Phabricator instance.

[DWARF] Generalized verification of .debug_abbrev to be applicable to both .debug_abbrev and .debug_abbrev.dwo sections.
ClosedPublic

Authored by sgravani on Jul 20 2017, 2:06 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

sgravani created this revision.Jul 20 2017, 2:06 PM
dblaikie added inline comments.Jul 20 2017, 2:26 PM
lib/DebugInfo/DWARF/DWARFVerifier.cpp
135 ↗(On Diff #107582)

General feedback: probably want to consistently use lowercase 'warning' and 'error' (or better yet/as well, maybe refactor error/warning handling to use a single function for printing warnings and errors).

Also there are two spaces between ".debug_abbrev" and "and" - should only be one.

Is there an existing warning about there being no debug_info section? And about debug_info not having a valid debug_abbrev? Then maybe this warning about missing debug_abbrev isn't necessary?

test/tools/llvm-dwarfdump/X86/verify_debug_abbrev.s
1 ↗(On Diff #107582)

This seems like a really big/long test - what's in basic.c? Does it need to be that complicated? (could it be simpler/shorter/etc?)

6–7 ↗(On Diff #107582)

Maybe worth mentioning the DIE tag? Or dumping the whole abbrev after/with the diagnostic?

sgravani updated this revision to Diff 107603.Jul 20 2017, 4:29 PM
sgravani marked 2 inline comments as done.

Addressed reviewer's comments.

lib/DebugInfo/DWARF/DWARFVerifier.cpp
135 ↗(On Diff #107582)

Partially fixed. I removed the warning from .debug_abbrev. Currently I'm printing a warning for .debug_info section as well, but I plan
to remove it with another patch. I also removed the extra space character.

I agree with having a function generating the errors/warnings. I could do this in another patch.
I could also add a verbose mode in another patch and output errors only when verbose is on.

dblaikie accepted this revision.Jul 20 2017, 4:32 PM
dblaikie added inline comments.
test/tools/llvm-dwarfdump/X86/verify_debug_abbrev.s
7 ↗(On Diff #107603)

Should check that the DIE gets dumped too

This revision is now accepted and ready to land.Jul 20 2017, 4:32 PM
sgravani marked an inline comment as done.Jul 20 2017, 5:52 PM
This revision was automatically updated to reflect the committed changes.