From 02113918ed6b5e514afd7d1e007131d36ac13f1d Mon Sep 17 00:00:00 2001 From: Jason Molenda Date: Thu, 9 Jan 2020 16:05:38 -0800 Subject: When reading Aux file in chunks, read consecutive byte ranges qemu has a very small maximum packet size (4096) and it actually only uses half of that buffer for some implementation reason, so when lldb asks for the register target definitions, the x86_64 definition is larger than 4096/2 and we need to fetch it in two parts. This patch and test is fixing a bug in GDBRemoteCommunicationClient::ReadExtFeature when reading a target file in multiple parts. lldb was assuming that it would always get back the maximum packet size response (4096) instead of using the actual size received and asking for the next group of bytes. We now have two tests in gdb_remote_client for unique features of qemu - TestNestedRegDefinitions.py would test the ability of lldb to follow multiple levels of xml includes; I opted to create a separate TestRegDefinitionInParts.py test to test this wrinkle in qemu's gdb remote serial protocol stub implementation. Instead of combining both tests into a single test file. --- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lldb/source/Plugins/Process/gdb-remote') diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index 19c3a5b4a0f..b2f1ee527e8 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -3740,7 +3740,7 @@ bool GDBRemoteCommunicationClient::ReadExtFeature( case ('m'): if (str.length() > 1) output << &str[1]; - offset += size; + offset += str.length() - 1; break; // unknown chunk -- cgit v1.2.3