Index: lldb/trunk/include/lldb/API/SBCommandInterpreter.h =================================================================== --- lldb/trunk/include/lldb/API/SBCommandInterpreter.h +++ lldb/trunk/include/lldb/API/SBCommandInterpreter.h @@ -94,6 +94,9 @@ static const char * GetArgumentDescriptionAsCString (const lldb::CommandArgumentType arg_type); + + static bool + EventIsCommandInterpreterEvent (const lldb::SBEvent &event); bool IsValid() const; Index: lldb/trunk/source/API/SBCommandInterpreter.cpp =================================================================== --- lldb/trunk/source/API/SBCommandInterpreter.cpp +++ lldb/trunk/source/API/SBCommandInterpreter.cpp @@ -20,6 +20,7 @@ #include "lldb/API/SBBroadcaster.h" #include "lldb/API/SBCommandReturnObject.h" #include "lldb/API/SBCommandInterpreter.h" +#include "lldb/API/SBEvent.h" #include "lldb/API/SBExecutionContext.h" #include "lldb/API/SBProcess.h" #include "lldb/API/SBTarget.h" @@ -548,6 +549,12 @@ } bool +SBCommandInterpreter::EventIsCommandInterpreterEvent (const lldb::SBEvent &event) +{ + return strcmp (event.GetBroadcasterClass(), SBCommandInterpreter::GetBroadcasterClass()) == 0; +} + +bool SBCommandInterpreter::SetCommandOverrideCallback (const char *command_name, lldb::CommandOverrideCallback callback, void *baton) Index: lldb/trunk/tools/lldb-mi/MICmnLLDBDebugger.cpp =================================================================== --- lldb/trunk/tools/lldb-mi/MICmnLLDBDebugger.cpp +++ lldb/trunk/tools/lldb-mi/MICmnLLDBDebugger.cpp @@ -296,7 +296,7 @@ eventMask = lldb::SBCommandInterpreter::eBroadcastBitQuitCommandReceived | lldb::SBCommandInterpreter::eBroadcastBitThreadShouldExit | lldb::SBCommandInterpreter::eBroadcastBitAsynchronousOutputData | lldb::SBCommandInterpreter::eBroadcastBitAsynchronousErrorData; - bOk = bOk && RegisterForEvent(strDbgId, CMIUtilString(lldb::SBCommandInterpreter::GetBroadcasterClass()), eventMask); + bOk = bOk && RegisterForEvent(strDbgId, m_lldbDebugger.GetCommandInterpreter().GetBroadcaster(), eventMask); return bOk; } Index: lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp =================================================================== --- lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp +++ lldb/trunk/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp @@ -28,6 +28,7 @@ #include "MICmnLLDBDebuggerHandleEvents.h" #include "MICmnResources.h" #include "MICmnLog.h" +#include "MICmnLLDBDebugger.h" #include "MICmnLLDBDebugSessionInfo.h" #include "MICmnMIResultRecord.h" #include "MICmnMIValueConst.h" @@ -146,6 +147,11 @@ vrbHandledEvent = true; bOk = HandleEventSBTarget(vEvent); } + else if (lldb::SBCommandInterpreter::EventIsCommandInterpreterEvent(vEvent)) + { + vrbHandledEvent = true; + bOk = HandleEventSBCommandInterpreter(vEvent); + } return bOk; } @@ -756,8 +762,12 @@ pEventType = "eBroadcastBitResetPrompt"; break; case lldb::SBCommandInterpreter::eBroadcastBitQuitCommandReceived: + { pEventType = "eBroadcastBitQuitCommandReceived"; + const bool bForceExit = true; + CMICmnLLDBDebugger::Instance().GetDriver().SetExitApplicationFlag(bForceExit); break; + } case lldb::SBCommandInterpreter::eBroadcastBitAsynchronousOutputData: pEventType = "eBroadcastBitAsynchronousOutputData"; break;