This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Add tests for DumpDataExtractor formats
ClosedPublic

Authored by DavidSpickett on Apr 28 2021, 6:56 AM.

Details

Reviewers
zturner
teemperor
Group Reviewers
Restricted Project
Commits
rG8fdfc1d64c51: [lldb] Add tests for DumpDataExtractor formats
Summary

Covering basic cases where you have 1 item on 1 line.

Apart from eFormatCharArray, where using multiple lines
highlights the difference between it and eFormatVectorOfChar.

Diff Detail

Event Timeline

DavidSpickett created this revision.Apr 28 2021, 6:56 AM
DavidSpickett requested review of this revision.Apr 28 2021, 6:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 28 2021, 6:56 AM
  • Remove unused cfloat include.
DavidSpickett added reviewers: Restricted Project, zturner.Apr 28 2021, 7:05 AM

I'm looking into printing memory tags and "memory read" uses this code a lot so I thought I'd add tests before I attempt to extend it.

If this is useful then I'll add some more covering some other key bits like splitting over multiple lines.

teemperor accepted this revision.Apr 29 2021, 9:20 AM
teemperor added a subscriber: teemperor.

FWIW, we do have a test for this named TestBuiltinFormats.py. It's using the SB API so it's not as a direct test as this one, so I think having this too is good.

I think this looks good otherwise so let's ship it. I have a few comments about the comments though, but that can be fixed while landing.

lldb/unittests/Core/DumpDataExtractorTest.cpp
28

Please change that to something like /*address_size=*/ where address_size is the exact argument name. This way clang-tidy can check the name for us.

75

I think the explanation is already good enough (and commented out code isn't great).

80

Can you put a period behind that comment and the others? Just being nit-picky here :)

176

same as above, please /*address_size=*/

179

Same as above, /*item_byte_size=*/1 (and the same below).

This revision is now accepted and ready to land.Apr 29 2021, 9:20 AM

Address review comments.

This revision was landed with ongoing or failed builds.Apr 30 2021, 2:29 AM
This revision was automatically updated to reflect the committed changes.
DavidSpickett marked 5 inline comments as done.Apr 30 2021, 2:30 AM