This is an archive of the discontinued LLVM Phabricator instance.

[llvm-dwarfdump] Add a test for --summarize-types
ClosedPublic

Authored by gbreynoo on Oct 20 2021, 9:21 AM.

Details

Summary

I could not find a test for --summarize-types, this change adds one.

Diff Detail

Event Timeline

gbreynoo created this revision.Oct 20 2021, 9:21 AM
gbreynoo requested review of this revision.Oct 20 2021, 9:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 20 2021, 9:21 AM

I was looking to do this in YAML but I don't think there is support for debug_types?

Higuoxing accepted this revision.Oct 20 2021, 6:59 PM

I was looking to do this in YAML but I don't think there is support for debug_types?

Yeah, you're right, yaml2obj doesn't support debug_types.

LGTM. Thanks!

This revision is now accepted and ready to land.Oct 20 2021, 6:59 PM
dblaikie requested changes to this revision.Oct 20 2021, 8:47 PM

I'm not sure what you mean that this feature isn't tested - a quick search through llvm/test seems to indicate a test case here: llvm/test/DebugInfo/dwarfdump-type-units.test:RUN: llvm-dwarfdump -v %p/Inputs/dwarfdump-type-units.elf-x86-64 -summarize-types | FileCheck -check-prefix=CHECK -check-prefix=SHORT %s - is this test inadequate?

This revision now requires changes to proceed.Oct 20 2021, 8:47 PM
gbreynoo updated this revision to Diff 381524.Oct 22 2021, 6:23 AM

Good catch dblaikie, I missed that test and it covers almost all I was testing here. This updated revision adds a check that I think was missing from the existing test.

Maybe adding -implicit-check-not=DW_TAG (or even -implicit-check-not=DW_ maybe) to the short FileCheck invocation would be suitable?

Using -implicit-check-not=DW_TAG fails due to finding the string output in other sections, I think the explicit check might be required.

Perhaps the summarize-types test could be changed to only dump -debug-types (passing that arg instead of -v to the llvm-dwarfdump invocation) & then it could use -implicit-check-not=DW_?

gbreynoo updated this revision to Diff 383364.Oct 29 2021, 8:28 AM

As suggested by dblaikie, now the call with summarize-types dumps -debug-types and not the other sections. To keep the useful check of the type_signature value it has been changed to the LONG prefix check.

dblaikie accepted this revision.Oct 29 2021, 2:33 PM

Looks good, thanks!

This revision is now accepted and ready to land.Oct 29 2021, 2:33 PM
This revision was automatically updated to reflect the committed changes.