diff options
author | Tamas Berghammer <tberghammer@google.com> | 2015-02-23 11:03:08 +0000 |
---|---|---|
committer | Tamas Berghammer <tberghammer@google.com> | 2015-02-23 11:03:08 +0000 |
commit | 0f86b74304934d5a493772fdd3f1e38e345f83d0 (patch) | |
tree | 7211bbe04111dc6af5d20ef83c381ef783b62276 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | |
parent | 04e6314cf4dab5d603776ef6bfbbfae1fa7fdaf4 (diff) | |
download | bcm5719-llvm-0f86b74304934d5a493772fdd3f1e38e345f83d0.tar.gz bcm5719-llvm-0f86b74304934d5a493772fdd3f1e38e345f83d0.zip |
Fix the communication in qPlatform_[mkdir,chmod]
With the previous implementation the protocol used by the client and the
server for the response was different and worked only by an accident.
With this change the communication is fixed and the return code from
mkdir and chmod correctly captured by lldb. The change also add
documentation for the qPlatform__[mkdir,chmod] packages.
Differential revision: http://reviews.llvm.org/D7786
llvm-svn: 230213
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index 8f81278c7b5..c1951e42694 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -3168,12 +3168,14 @@ GDBRemoteCommunicationClient::MakeDirectory (const char *path, const char *packet = stream.GetData(); int packet_len = stream.GetSize(); StringExtractorGDBRemote response; - if (SendPacketAndWaitForResponse(packet, packet_len, response, false) == PacketResult::Success) - { - return Error(response.GetHexMaxU32(false, UINT32_MAX), eErrorTypePOSIX); - } - return Error(); + if (SendPacketAndWaitForResponse(packet, packet_len, response, false) != PacketResult::Success) + return Error("failed to send '%s' packet", packet); + + if (response.GetChar() != 'F') + return Error("invalid response to '%s' packet", packet); + + return Error(response.GetU32(UINT32_MAX), eErrorTypePOSIX); } Error @@ -3188,12 +3190,14 @@ GDBRemoteCommunicationClient::SetFilePermissions (const char *path, const char *packet = stream.GetData(); int packet_len = stream.GetSize(); StringExtractorGDBRemote response; - if (SendPacketAndWaitForResponse(packet, packet_len, response, false) == PacketResult::Success) - { - return Error(response.GetHexMaxU32(false, UINT32_MAX), eErrorTypePOSIX); - } - return Error(); - + + if (SendPacketAndWaitForResponse(packet, packet_len, response, false) != PacketResult::Success) + return Error("failed to send '%s' packet", packet); + + if (response.GetChar() != 'F') + return Error("invalid response to '%s' packet", packet); + + return Error(response.GetU32(false, UINT32_MAX), eErrorTypePOSIX); } static uint64_t |