diff options
| author | Jim Ingham <jingham@apple.com> | 2014-03-28 20:00:07 +0000 |
|---|---|---|
| committer | Jim Ingham <jingham@apple.com> | 2014-03-28 20:00:07 +0000 |
| commit | 6c8824d216c808f211be8ef4014ee0d750cfe795 (patch) | |
| tree | 0ddaebc6a0e1c4e654c51050f45d796e5d109a50 /lldb/source/Plugins/Process/gdb-remote | |
| parent | 950667a331d2a9aab35a9657e1eca2160ef77853 (diff) | |
| download | bcm5719-llvm-6c8824d216c808f211be8ef4014ee0d750cfe795.tar.gz bcm5719-llvm-6c8824d216c808f211be8ef4014ee0d750cfe795.zip | |
Wait for the reply from the 'D' detach packet before tearing down the debugger. Avoids a race
condition where we could end up killing debugserver (and thus the target) before it had a chance
to detach.
Also fix debugserver to send the OK AFTER it detaches to avoid the same race condition.
<rdar://problem/16202713>
llvm-svn: 205043
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote')
| -rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index 9b9de22808c..e27186ff86c 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -1756,14 +1756,16 @@ GDBRemoteCommunicationClient::Detach (bool keep_stopped) } else { - PacketResult packet_result = SendPacket ("D1", 2); + StringExtractorGDBRemote response; + PacketResult packet_result = SendPacketAndWaitForResponse ("D1", 1, response, false); if (packet_result != PacketResult::Success) error.SetErrorString ("Sending extended disconnect packet failed."); } } else { - PacketResult packet_result = SendPacket ("D", 1); + StringExtractorGDBRemote response; + PacketResult packet_result = SendPacketAndWaitForResponse ("D", 1, response, false); if (packet_result != PacketResult::Success) error.SetErrorString ("Sending disconnect packet failed."); } |

