Recommitting r180831 with trivial fix - remember to return errors if you compute.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@180898 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 1b4627a..06e15ab 100644
--- a/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -1696,25 +1696,29 @@
}
Error
-ProcessGDBRemote::DoDetach()
+ProcessGDBRemote::DoDetach(bool keep_stopped)
{
Error error;
Log *log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
if (log)
- log->Printf ("ProcessGDBRemote::DoDetach()");
-
+ log->Printf ("ProcessGDBRemote::DoDetach(keep_stopped: %i)", keep_stopped);
+
DisableAllBreakpointSites ();
m_thread_list.DiscardThreadPlans();
- bool success = m_gdb_comm.Detach ();
+ error = m_gdb_comm.Detach (keep_stopped);
if (log)
{
- if (success)
+ if (error.Success())
log->PutCString ("ProcessGDBRemote::DoDetach() detach packet sent successfully");
else
- log->PutCString ("ProcessGDBRemote::DoDetach() detach packet send failed");
+ log->Printf ("ProcessGDBRemote::DoDetach() detach packet send failed: %s", error.AsCString() ? error.AsCString() : "<unknown error>");
}
+
+ if (!error.Success())
+ return error;
+
// Sleep for one second to let the process get all detached...
StopAsyncThread ();