This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Add --show-tags option to "memory find"
ClosedPublic

Authored by DavidSpickett on May 6 2022, 5:46 AM.

Details

Summary

This is off by default. If you get a result and that
memory has memory tags, when --show-tags is given you'll
see the tags inline with the memory content.

(lldb) memory read mte_buf mte_buf+64 --show-tags
<...>
0xfffff7ff8020: 00 00 00 00 00 00 00 00 0d f0 fe ca 00 00 00 00 ................ (tag: 0x2)
<...>
(lldb) memory find -e 0xcafef00d mte_buf mte_buf+64 --show-tags
data found at location: 0xfffff7ff8028
0xfffff7ff8028: 0d f0 fe ca 00 00 00 00 00 00 00 00 00 00 00 00 ................ (tags: 0x2 0x3)
0xfffff7ff8038: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ (tags: 0x3 0x4)

The logic for handling alignments is the same as for memory read
so in the above example because the line starts misaligned to the
granule it covers 2 granules.

Depends on D125089

Diff Detail

Event Timeline

DavidSpickett created this revision.May 6 2022, 5:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 6 2022, 5:46 AM
DavidSpickett requested review of this revision.May 6 2022, 5:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 6 2022, 5:46 AM
DavidSpickett edited the summary of this revision. (Show Details)May 6 2022, 5:49 AM

Test that show-tags without finding anything doesn't do anything strange.

The logic for handling misalignment is all done in DumpDataExtractor so that is covered by the "memory read --show-tags" tests.

Add a release note.

Herald added a project: Restricted Project. · View Herald TranscriptMay 6 2022, 5:59 AM
omjavaid accepted this revision.May 17 2022, 8:44 PM
This revision is now accepted and ready to land.May 17 2022, 8:44 PM
This revision was landed with ongoing or failed builds.May 19 2022, 6:40 AM
This revision was automatically updated to reflect the committed changes.