llvm/lldb/source/Utility
David Spickett 7d27230de3 [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
2021-07-27 12:02:17 +01:00
..
ArchSpec.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
Args.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
ARM64_DWARF_Registers.h
ARM64_ehframe_Registers.h
ARM_DWARF_Registers.h
ARM_ehframe_Registers.h
Baton.cpp
Broadcaster.cpp
CMakeLists.txt
CompletionRequest.cpp
Connection.cpp
ConstString.cpp [lldb] Rename StringRef _lower() method calls to _insensitive() 2021-06-25 00:22:01 +03:00
DataBufferHeap.cpp
DataBufferLLVM.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
DataEncoder.cpp
DataExtractor.cpp
Environment.cpp
Event.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
FileSpec.cpp [lldb] Rename StringRef _lower() method calls to _insensitive() 2021-06-25 00:22:01 +03:00
GDBRemote.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
IOObject.cpp
Listener.cpp
LLDBAssert.cpp
Log.cpp [lldb] Rename StringRef _lower() method calls to _insensitive() 2021-06-25 00:22:01 +03:00
Logging.cpp
NameMatches.cpp
PPC64_DWARF_Registers.h
PPC64LE_DWARF_Registers.h
ProcessInfo.cpp
RegisterValue.cpp
RegularExpression.cpp
Reproducer.cpp
ReproducerInstrumentation.cpp
ReproducerProvider.cpp
Scalar.cpp [lldb] Fix compilation after removal of APInt::toString 2021-06-11 16:20:57 +02:00
SelectHelper.cpp
State.cpp
Status.cpp
Stream.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
StreamCallback.cpp
StreamString.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
StringExtractor.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
StringExtractorGDBRemote.cpp [lldb][AArch64] Add memory tag writing to lldb-server 2021-07-27 12:02:17 +01:00
StringLexer.cpp
StringList.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
StructuredData.cpp
TildeExpressionResolver.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
Timer.cpp Allow signposts to take advantage of deferred string substitution 2021-06-14 16:53:41 -07:00
TraceGDBRemotePackets.cpp
TraceIntelPTGDBRemotePackets.cpp [intel pt] Add TSC timestamps 2021-07-20 16:29:17 -07:00
UnimplementedError.cpp
UriParser.cpp
UserID.cpp
UserIDResolver.cpp
UUID.cpp
UuidCompatibility.h
VASprintf.cpp
VMRange.cpp
XcodeSDK.cpp