This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG3c3269559ba9: [lldb] [gdb-remote client] Avoid zero padding
PID/TID in H packet (authored by mgorny).
Herald added a project: LLDB.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D106832/new/
https://reviews.llvm.org/D106832
Files:
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
Index: lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
===================================================================
--- lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
+++ lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
@@ -98,7 +98,7 @@
});
Handle_QThreadSuffixSupported(server, false);
- HandlePacket(server, "Hg0000000000000047", "OK");
+ HandlePacket(server, "Hg47", "OK");
HandlePacket(server, "P4=" + one_register_hex, "OK");
ASSERT_TRUE(write_result.get());
@@ -143,7 +143,7 @@
return client.SaveRegisterState(tid, save_id);
});
Handle_QThreadSuffixSupported(server, false);
- HandlePacket(server, "Hg0000000000000047", "OK");
+ HandlePacket(server, "Hg47", "OK");
HandlePacket(server, "QSaveRegisterState", "1");
ASSERT_TRUE(async_result.get());
EXPECT_EQ(1u, save_id);
Index: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
===================================================================
--- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -2639,16 +2639,13 @@
packet.PutChar('H');
packet.PutChar(op);
- if (pid != LLDB_INVALID_PROCESS_ID) {
- packet.PutChar('p');
- packet.PutHex64(pid);
- packet.PutChar('.');
- }
+ if (pid != LLDB_INVALID_PROCESS_ID)
+ packet.Printf("p%" PRIx64 ".", pid);
if (tid == UINT64_MAX)
packet.PutCString("-1");
else
- packet.PutHex64(tid);
+ packet.Printf("%" PRIx64, tid);
StringExtractorGDBRemote response;
if (SendPacketAndWaitForResponse(packet.GetString(), response)
Index: lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
===================================================================
--- lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
+++ lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
@@ -98,7 +98,7 @@
});
Handle_QThreadSuffixSupported(server, false);
- HandlePacket(server, "Hg0000000000000047", "OK");
+ HandlePacket(server, "Hg47", "OK");
HandlePacket(server, "P4=" + one_register_hex, "OK");
ASSERT_TRUE(write_result.get());
@@ -143,7 +143,7 @@
return client.SaveRegisterState(tid, save_id);
});
Handle_QThreadSuffixSupported(server, false);
- HandlePacket(server, "Hg0000000000000047", "OK");
+ HandlePacket(server, "Hg47", "OK");
HandlePacket(server, "QSaveRegisterState", "1");
ASSERT_TRUE(async_result.get());
EXPECT_EQ(1u, save_id);
Index: lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
===================================================================
--- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -2639,16 +2639,13 @@
packet.PutChar('H');
packet.PutChar(op);
- if (pid != LLDB_INVALID_PROCESS_ID) {
- packet.PutChar('p');
- packet.PutHex64(pid);
- packet.PutChar('.');
- }
+ if (pid != LLDB_INVALID_PROCESS_ID)
+ packet.Printf("p%" PRIx64 ".", pid);
if (tid == UINT64_MAX)
packet.PutCString("-1");
else
- packet.PutHex64(tid);
+ packet.Printf("%" PRIx64, tid);
StringExtractorGDBRemote response;
if (SendPacketAndWaitForResponse(packet.GetString(), response)
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits