This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Add "memory tag write" --end-addr option
ClosedPublic

Authored by DavidSpickett on Jun 30 2021, 4:09 AM.

Details

Summary

The default mode of "memory tag write" is to calculate the
range from the start address and the number of tags given.
(just like "memory write" does)

(lldb) memory tag write mte_buf 1 2
(lldb) memory tag read mte_buf mte_buf+48
Logical tag: 0x0
Allocation tags:
[0xfffff7ff9000, 0xfffff7ff9010): 0x1
[0xfffff7ff9010, 0xfffff7ff9020): 0x2
[0xfffff7ff9020, 0xfffff7ff9030): 0x0

This new option allows you to set an end address and have
the tags repeat until that point.

(lldb) memory tag write mte_buf 1 2 --end-addr mte_buf+64
(lldb) memory tag read mte_buf mte_buf+80
Logical tag: 0x0
Allocation tags:
[0xfffff7ff9000, 0xfffff7ff9010): 0x1
[0xfffff7ff9010, 0xfffff7ff9020): 0x2
[0xfffff7ff9020, 0xfffff7ff9030): 0x1
[0xfffff7ff9030, 0xfffff7ff9040): 0x2
[0xfffff7ff9040, 0xfffff7ff9050): 0x0

This is implemented using the QMemTags packet previously
added. We skip validating the number of tags in lldb and send
them on to lldb-server, which repeats them as needed.

Apart from the number of tags, all the other client side checks
remain. Tag values, memory range must be tagged, etc.

Diff Detail

Event Timeline

DavidSpickett created this revision.Jun 30 2021, 4:09 AM
DavidSpickett requested review of this revision.Jun 30 2021, 4:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 30 2021, 4:09 AM

Rebase after refactoring.

omjavaid accepted this revision.Jul 23 2021, 2:50 AM
This revision is now accepted and ready to land.Jul 23 2021, 2:50 AM
This revision was landed with ongoing or failed builds.Jul 28 2021, 6:05 AM
This revision was automatically updated to reflect the committed changes.