diff options
author | Greg Clayton <gclayton@apple.com> | 2013-12-06 21:45:27 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2013-12-06 21:45:27 +0000 |
commit | 3dedae12b5453757055857e83a1f2624bf08d914 (patch) | |
tree | 9394760a1d2f54ddf4438a3eca18b493480c608c /lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp | |
parent | 0db73111a97137b10897ab8e544d4d9d25f39ce5 (diff) | |
download | llvm-3dedae12b5453757055857e83a1f2624bf08d914.zip llvm-3dedae12b5453757055857e83a1f2624bf08d914.tar.gz llvm-3dedae12b5453757055857e83a1f2624bf08d914.tar.bz2 |
Fixed the GDBRemoteCommuncation to return a new GDBRemoteCommuncation::PacketResult enum for all packet sends/receives.
<rdar://problem/15600045>
Due to other recent changes, all connections to GDB servers that didn't support the "QStartNoAckMode" packet would cause us to fail to attach to the remote GDB server.
The problem was that SendPacket* and WaitForResponse* packets would return a size_t indicating the number of bytes sent/received. The other issue was WaitForResponse* packets would strip the leading '$' and the trailing "#CC" (checksum) bytes, so the unimplemented response packet of "$#00" would get stripped and the WaitForResponse* packets would return 0.
These new error codes give us flexibility to to more intelligent things in response to what is returned.
llvm-svn: 196610
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp index c291df7..73b9b3e 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp @@ -275,7 +275,7 @@ GDBRemoteRegisterContext::SetPrimordialRegister(const lldb_private::RegisterInfo if (gdb_comm.SendPacketAndWaitForResponse(packet.GetString().c_str(), packet.GetString().size(), response, - false)) + false) == GDBRemoteCommunication::PacketResult::Success) { if (response.IsOKResponse()) return true; @@ -298,7 +298,7 @@ GDBRemoteRegisterContext::SyncThreadState(Process *process) if (gdb_comm.SendPacketAndWaitForResponse(packet.GetString().c_str(), packet.GetString().size(), response, - false)) + false) == GDBRemoteCommunication::PacketResult::Success) { if (response.IsOKResponse()) InvalidateAllRegisters(); @@ -363,7 +363,7 @@ GDBRemoteRegisterContext::WriteRegisterBytes (const lldb_private::RegisterInfo * if (gdb_comm.SendPacketAndWaitForResponse(packet.GetString().c_str(), packet.GetString().size(), response, - false)) + false) == GDBRemoteCommunication::PacketResult::Success) { SetAllRegisterValid (false); if (response.IsOKResponse()) @@ -519,7 +519,7 @@ GDBRemoteRegisterContext::ReadAllRegisterValues (lldb::DataBufferSP &data_sp) packet_len = ::snprintf (packet, sizeof(packet), "g"); assert (packet_len < ((int)sizeof(packet) - 1)); - if (gdb_comm.SendPacketAndWaitForResponse(packet, packet_len, response, false)) + if (gdb_comm.SendPacketAndWaitForResponse(packet, packet_len, response, false) == GDBRemoteCommunication::PacketResult::Success) { if (response.IsErrorResponse()) return false; @@ -591,7 +591,7 @@ GDBRemoteRegisterContext::WriteAllRegisterValues (const lldb::DataBufferSP &data if (gdb_comm.SendPacketAndWaitForResponse (G_packet, G_packet_len, response, - false)) + false) == GDBRemoteCommunication::PacketResult::Success) { if (response.IsOKResponse()) return true; @@ -660,7 +660,7 @@ GDBRemoteRegisterContext::WriteAllRegisterValues (const lldb::DataBufferSP &data if (gdb_comm.SendPacketAndWaitForResponse(packet.GetString().c_str(), packet.GetString().size(), response, - false)) + false) == GDBRemoteCommunication::PacketResult::Success) { if (response.IsOKResponse()) ++num_restored; |