forked from qt-creator/qt-creator
Debugger: Cleaner shutdown of LLDB/python machinery
Change-Id: I482e78c352066ddd05e96199fd8ead088e3e9f58 Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -525,6 +525,7 @@ class Dumper:
|
||||
self.sizetType_ = None
|
||||
self.charPtrType_ = None
|
||||
self.voidType_ = None
|
||||
self.isShuttingDown_ = False
|
||||
|
||||
def extractTemplateArgument(self, typename, index):
|
||||
level = 0
|
||||
@@ -1020,9 +1021,12 @@ class Dumper:
|
||||
self.report('state="%s"' % stateNames[state])
|
||||
self.eventState = state
|
||||
if state == lldb.eStateExited:
|
||||
warn("PROCESS EXITED. %d: %s"
|
||||
% (self.process.GetExitStatus(), self.process.GetExitDescription()))
|
||||
if self.isShuttingDown_:
|
||||
self.report('state="inferiorshutdownok"')
|
||||
else:
|
||||
self.report('state="inferiorexited"')
|
||||
self.report('exited={status="%s",desc="%s"}'
|
||||
% (self.process.GetExitStatus(), self.process.GetExitDescription()))
|
||||
if type == lldb.SBProcess.eBroadcastBitStateChanged:
|
||||
self.reportData()
|
||||
elif type == lldb.SBProcess.eBroadcastBitInterrupt:
|
||||
@@ -1190,8 +1194,13 @@ class Dumper:
|
||||
def executeStep(self, _ = None):
|
||||
self.currentThread().StepInto()
|
||||
|
||||
def shutdownInferior(self, _ = None):
|
||||
self.isShuttingDown_ = True
|
||||
self.process.Kill()
|
||||
|
||||
def quit(self, _ = None):
|
||||
self.debugger.Terminate()
|
||||
self.report('state="engineshutdownok"')
|
||||
self.process.Kill()
|
||||
|
||||
def executeStepI(self, _ = None):
|
||||
self.currentThread().StepInstruction(lldb.eOnlyThisThread)
|
||||
@@ -1229,11 +1238,7 @@ class Dumper:
|
||||
command = args['command']
|
||||
self.debugger.GetCommandInterpreter().HandleCommand(command, result)
|
||||
success = result.Succeeded()
|
||||
if success:
|
||||
output = result.GetOutput()
|
||||
error = ''
|
||||
else:
|
||||
output = ''
|
||||
error = str(result.GetError())
|
||||
self.report('success="%d",output="%s",error="%s"' % (success, output, error))
|
||||
|
||||
|
@@ -119,7 +119,7 @@ void LldbEngine::runCommand(const Command &command)
|
||||
void LldbEngine::shutdownInferior()
|
||||
{
|
||||
QTC_ASSERT(state() == InferiorShutdownRequested, qDebug() << state());
|
||||
notifyInferiorShutdownOk();
|
||||
runCommand(Command("shutdownInferior"));
|
||||
}
|
||||
|
||||
void LldbEngine::shutdownEngine()
|
||||
@@ -1018,6 +1018,14 @@ void LldbEngine::refreshState(const GdbMi &reportedState)
|
||||
notifyEngineRunAndInferiorRunOk();
|
||||
else if (newState == "enginerunandinferiorstopok")
|
||||
notifyEngineRunAndInferiorStopOk();
|
||||
else if (newState == "inferiorshutdownok")
|
||||
notifyInferiorShutdownOk();
|
||||
else if (newState == "inferiorshutdownfailed")
|
||||
notifyInferiorShutdownFailed();
|
||||
else if (newState == "engineshutdownok")
|
||||
notifyEngineShutdownOk();
|
||||
else if (newState == "engineshutdownfailed")
|
||||
notifyEngineShutdownFailed();
|
||||
else if (newState == "inferiorexited")
|
||||
notifyInferiorExited();
|
||||
}
|
||||
|
Reference in New Issue
Block a user