summaryrefslogtreecommitdiffstats
path: root/lldb/tools/lldb-mi/MIDriver.cpp
diff options
context:
space:
mode:
authorIlia K <ki.stfu@gmail.com>2015-05-07 06:45:42 +0000
committerIlia K <ki.stfu@gmail.com>2015-05-07 06:45:42 +0000
commit8913012ee97c8911b4bf95784f70ada3dd94ce44 (patch)
treead957e1bea0b1e79b876fd6d8b5f2115ec9d7267 /lldb/tools/lldb-mi/MIDriver.cpp
parent43f7439cf59edd0f4400a12036f8a19745369f3f (diff)
downloadbcm5719-llvm-8913012ee97c8911b4bf95784f70ada3dd94ce44.tar.gz
bcm5719-llvm-8913012ee97c8911b4bf95784f70ada3dd94ce44.zip
Remove quit hook in CMIDriver::DoMainLoop (MI)
Summary: This patch removes quit hook and fixes 1 bug: # Fix "quit" hook in CMIDriver::DoMainLoop (MI) # Fix bug when the handler thread exits without any notification (MI) # Fix a race condition in CMICmnLLDBDebugger::MonitorSBListenerEvents (MI) Test Plan: ./dotest.py -v --executable $BUILDDIR/bin/lldb tools/lldb-mi/ Reviewers: abidh Reviewed By: abidh Subscribers: lldb-commits, abidh Differential Revision: http://reviews.llvm.org/D9275 llvm-svn: 236702
Diffstat (limited to 'lldb/tools/lldb-mi/MIDriver.cpp')
-rw-r--r--lldb/tools/lldb-mi/MIDriver.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lldb/tools/lldb-mi/MIDriver.cpp b/lldb/tools/lldb-mi/MIDriver.cpp
index c24f193e894..7d1d9e45b6d 100644
--- a/lldb/tools/lldb-mi/MIDriver.cpp
+++ b/lldb/tools/lldb-mi/MIDriver.cpp
@@ -536,12 +536,8 @@ CMIDriver::DoMainLoop(void)
CMIUtilString lineText(pCmd);
if (!lineText.empty ())
{
- if (lineText == "quit")
- {
- // We want to be exiting when receiving a quit command
- m_bExitApp = true;
- break;
- }
+ // Check that the handler thread is alive (otherwise we stuck here)
+ assert(CMICmnLLDBDebugger::Instance().ThreadIsActive());
{
// Lock Mutex before processing commands so that we don't disturb an event
@@ -549,9 +545,13 @@ CMIDriver::DoMainLoop(void)
CMIUtilThreadLock lock(CMICmnLLDBDebugSessionInfo::Instance().GetSessionMutex());
bOk = InterpretCommand(lineText);
}
+
// Draw prompt if desired
if (bOk && m_rStdin.GetEnablePrompt())
bOk = m_rStdOut.WriteMIResponse(m_rStdin.GetPrompt());
+
+ // Wait while the handler thread handles incoming events
+ CMICmnLLDBDebugger::Instance().WaitForHandleEvent();
}
}
}
OpenPOWER on IntegriCloud