[lldb] Re-enable GDB server client memory tag read tests

These were disabled in 473a3a773e
because they failed on 32 bit platforms. (Arm for sure but I assume
any 32 bit)

This was due to the printf formatter used. These assumed
that types like uint64_t/size_t would be certain size/type and
that changes on 32 bit.

Instead use "z" to print the size_t and PRI<...> formatters
for the addr_t (always uint64_t) and the int32_t.
This commit is contained in:
David Spickett 2021-06-25 09:57:46 +00:00
parent 79c98279b6
commit 6e5c4a443d
2 changed files with 2 additions and 3 deletions

View File

@ -590,7 +590,7 @@ DataBufferSP GDBRemoteCommunicationClient::ReadMemoryTags(lldb::addr_t addr,
size_t len, size_t len,
int32_t type) { int32_t type) {
StreamString packet; StreamString packet;
packet.Printf("qMemTags:%lx,%lx:%x", addr, len, type); packet.Printf("qMemTags:%" PRIx64 ",%zx:%" PRIx32, addr, len, type);
StringExtractorGDBRemote response; StringExtractorGDBRemote response;
Log *log = ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet(GDBR_LOG_MEMORY); Log *log = ProcessGDBRemoteLog::GetLogIfAnyCategoryIsSet(GDBR_LOG_MEMORY);

View File

@ -465,7 +465,7 @@ TEST_F(GDBRemoteCommunicationClientTest, GetQOffsets) {
EXPECT_EQ(llvm::None, GetQOffsets("TextSeg=0x1234")); EXPECT_EQ(llvm::None, GetQOffsets("TextSeg=0x1234"));
EXPECT_EQ(llvm::None, GetQOffsets("TextSeg=12345678123456789")); EXPECT_EQ(llvm::None, GetQOffsets("TextSeg=12345678123456789"));
} }
#if 0
static void static void
check_qmemtags(TestClient &client, MockServer &server, size_t read_len, check_qmemtags(TestClient &client, MockServer &server, size_t read_len,
const char *packet, llvm::StringRef response, const char *packet, llvm::StringRef response,
@ -530,4 +530,3 @@ TEST_F(GDBRemoteCommunicationClientTest, ReadMemoryTags) {
check_qmemtags(client, server, 32, "qMemTags:def0,20:1", "m01020", check_qmemtags(client, server, 32, "qMemTags:def0,20:1", "m01020",
llvm::None); llvm::None);
} }
#endif