summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2011-10-28 01:11:35 +0000
committerJim Ingham <jingham@apple.com>2011-10-28 01:11:35 +0000
commitaab78371b9273426a13d76bea5855640e650a056 (patch)
tree1c6c32f3a61fc533d767aad0d679782e5a0c4bf4 /lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
parent2a781097f37bab041ed2cafb7cbcd95096fad46c (diff)
downloadbcm5719-llvm-aab78371b9273426a13d76bea5855640e650a056.tar.gz
bcm5719-llvm-aab78371b9273426a13d76bea5855640e650a056.zip
Fix up how we shut down the communication with debugserver so we don't rely on
debugserver being responsive to shut down. llvm-svn: 143174
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp')
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 917fc4df360..7f842c2ecc1 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -1511,9 +1511,6 @@ ProcessGDBRemote::DoDetach()
// Sleep for one second to let the process get all detached...
StopAsyncThread ();
- m_gdb_comm.StopReadThread();
- m_gdb_comm.Disconnect(); // Disconnect from the debug server.
-
SetPrivateState (eStateDetached);
ResumePrivateStateThread();
@@ -1532,13 +1529,7 @@ ProcessGDBRemote::DoDestroy ()
// Interrupt if our inferior is running...
if (m_gdb_comm.IsConnected())
{
- if (m_public_state.GetValue() == eStateAttaching)
- {
- // We are being asked to halt during an attach. We need to just close
- // our file handle and debugserver will go away, and we can be done...
- m_gdb_comm.Disconnect();
- }
- else
+ if (m_public_state.GetValue() != eStateAttaching)
{
StringExtractorGDBRemote response;
@@ -1561,9 +1552,7 @@ ProcessGDBRemote::DoDestroy ()
}
}
StopAsyncThread ();
- m_gdb_comm.StopReadThread();
KillDebugserverProcess ();
- m_gdb_comm.Disconnect(); // Disconnect from the debug server.
return error;
}
@@ -2294,6 +2283,9 @@ ProcessGDBRemote::StopAsyncThread ()
log->Printf ("ProcessGDBRemote::%s ()", __FUNCTION__);
m_async_broadcaster.BroadcastEvent (eBroadcastBitAsyncThreadShouldExit);
+
+ // This will shut down the async thread.
+ m_gdb_comm.Disconnect(); // Disconnect from the debug server.
// Stop the stdio thread
if (IS_VALID_LLDB_HOST_THREAD(m_async_thread))
OpenPOWER on IntegriCloud