[Lldb-commits] [PATCH] D105183: [lldb] Add "memory tag write" --end-addr option

David Spickett via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jun 30 04:09:48 PDT 2021


DavidSpickett created this revision.
Herald added a subscriber: dang.
DavidSpickett requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D105183

Files:
  lldb/source/Commands/CommandObjectMemoryTag.cpp
  lldb/source/Commands/Options.td
  lldb/test/API/linux/aarch64/mte_tag_access/TestAArch64LinuxMTEMemoryTagAccess.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105183.355502.patch
Type: text/x-patch
Size: 9611 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210630/fb230f77/attachment.bin>


More information about the lldb-commits mailing list