From f105f588b31b4384bb48f528784cb05ae0eec060 Mon Sep 17 00:00:00 2001 From: Todd Fiala Date: Sat, 21 Jun 2014 00:48:09 +0000 Subject: Fix a gdbremote bug in _M/_m stub support detection. When a stub reported $#00 (unsupported) for _M and _m packets, the unsupported response was not handled and the client then marked the _M/_m commands as definitely supported. However, they would always fail, preventing lldb's fallback InferiorCallMmap-based allocation strategy from being used to attempt to allocate memory in the inferior process space. llvm-svn: 211425 --- .../Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lldb/source/Plugins/Process') diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index 4ba2ca1e435..f7beac2100e 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -1881,7 +1881,9 @@ GDBRemoteCommunicationClient::AllocateMemory (size_t size, uint32_t permissions) StringExtractorGDBRemote response; if (SendPacketAndWaitForResponse (packet, packet_len, response, false) == PacketResult::Success) { - if (!response.IsErrorResponse()) + if (response.IsUnsupportedResponse()) + m_supports_alloc_dealloc_memory = eLazyBoolNo; + else if (!response.IsErrorResponse()) return response.GetHexMaxU64(false, LLDB_INVALID_ADDRESS); } else @@ -1904,7 +1906,9 @@ GDBRemoteCommunicationClient::DeallocateMemory (addr_t addr) StringExtractorGDBRemote response; if (SendPacketAndWaitForResponse (packet, packet_len, response, false) == PacketResult::Success) { - if (response.IsOKResponse()) + if (response.IsUnsupportedResponse()) + m_supports_alloc_dealloc_memory = eLazyBoolNo; + else if (response.IsOKResponse()) return true; } else -- cgit v1.2.3