aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Utility/StringExtractorGDBRemote.cpp
diff options
context:
space:
mode:
authorDavid Spickett <david.spickett@linaro.org>2021-03-31 14:02:34 +0100
committerDavid Spickett <david.spickett@linaro.org>2021-07-27 12:02:17 +0100
commit7d27230de3336b8c79bfdc90f59858f6dad28fa5 (patch)
treedf523622b95d310a6e102d2e9aeb9e9322719d03 /lldb/source/Utility/StringExtractorGDBRemote.cpp
parentd7dd12aee399a19e890143604b6993f02232ca24 (diff)
downloadllvm-7d27230de3336b8c79bfdc90f59858f6dad28fa5.zip
llvm-7d27230de3336b8c79bfdc90f59858f6dad28fa5.tar.gz
llvm-7d27230de3336b8c79bfdc90f59858f6dad28fa5.tar.bz2
[lldb][AArch64] Add memory tag writing to lldb-server
This is implemented using the QMemTags packet, as specified by GDB in: https://sourceware.org/gdb/current/onlinedocs/gdb/General-Query-Packets.html#General-Query-Packets (recall that qMemTags was previously added to read tags) On receipt of a valid packet lldb-server will: * align the given address and length to granules (most of the time lldb will have already done this but the specification doesn't guarantee it) * Repeat the supplied tags as many times as needed to cover the range. (if tags > range we just use as many as needed) * Call ptrace POKEMTETAGS to write the tags. The ptrace step will loop just like the tag read does, until all tags are written or we get an error. Meaning that if ptrace succeeds it could be a partial write. So we call it again and if we then get an error, return an error to lldb. We are not going to attempt to restore tags after a partial write followed by an error. This matches the behaviour of the existing memory writes. The lldb-server tests have been extended to include read and write in the same test file. With some updated function names since "qMemTags" vs "QMemTags" isn't very clear when they're next to each other. Reviewed By: omjavaid Differential Revision: https://reviews.llvm.org/D105180
Diffstat (limited to 'lldb/source/Utility/StringExtractorGDBRemote.cpp')
-rw-r--r--lldb/source/Utility/StringExtractorGDBRemote.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lldb/source/Utility/StringExtractorGDBRemote.cpp b/lldb/source/Utility/StringExtractorGDBRemote.cpp
index bcc40f4..29cf585 100644
--- a/lldb/source/Utility/StringExtractorGDBRemote.cpp
+++ b/lldb/source/Utility/StringExtractorGDBRemote.cpp
@@ -143,6 +143,11 @@ StringExtractorGDBRemote::GetServerPacketType() const {
return eServerPacketType_QListThreadsInStopReply;
break;
+ case 'M':
+ if (PACKET_STARTS_WITH("QMemTags"))
+ return eServerPacketType_QMemTags;
+ break;
+
case 'R':
if (PACKET_STARTS_WITH("QRestoreRegisterState:"))
return eServerPacketType_QRestoreRegisterState;