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.sizetType_ = None
|
||||||
self.charPtrType_ = None
|
self.charPtrType_ = None
|
||||||
self.voidType_ = None
|
self.voidType_ = None
|
||||||
|
self.isShuttingDown_ = False
|
||||||
|
|
||||||
def extractTemplateArgument(self, typename, index):
|
def extractTemplateArgument(self, typename, index):
|
||||||
level = 0
|
level = 0
|
||||||
@@ -1020,9 +1021,12 @@ class Dumper:
|
|||||||
self.report('state="%s"' % stateNames[state])
|
self.report('state="%s"' % stateNames[state])
|
||||||
self.eventState = state
|
self.eventState = state
|
||||||
if state == lldb.eStateExited:
|
if state == lldb.eStateExited:
|
||||||
warn("PROCESS EXITED. %d: %s"
|
if self.isShuttingDown_:
|
||||||
% (self.process.GetExitStatus(), self.process.GetExitDescription()))
|
self.report('state="inferiorshutdownok"')
|
||||||
|
else:
|
||||||
self.report('state="inferiorexited"')
|
self.report('state="inferiorexited"')
|
||||||
|
self.report('exited={status="%s",desc="%s"}'
|
||||||
|
% (self.process.GetExitStatus(), self.process.GetExitDescription()))
|
||||||
if type == lldb.SBProcess.eBroadcastBitStateChanged:
|
if type == lldb.SBProcess.eBroadcastBitStateChanged:
|
||||||
self.reportData()
|
self.reportData()
|
||||||
elif type == lldb.SBProcess.eBroadcastBitInterrupt:
|
elif type == lldb.SBProcess.eBroadcastBitInterrupt:
|
||||||
@@ -1190,8 +1194,13 @@ class Dumper:
|
|||||||
def executeStep(self, _ = None):
|
def executeStep(self, _ = None):
|
||||||
self.currentThread().StepInto()
|
self.currentThread().StepInto()
|
||||||
|
|
||||||
|
def shutdownInferior(self, _ = None):
|
||||||
|
self.isShuttingDown_ = True
|
||||||
|
self.process.Kill()
|
||||||
|
|
||||||
def quit(self, _ = None):
|
def quit(self, _ = None):
|
||||||
self.debugger.Terminate()
|
self.report('state="engineshutdownok"')
|
||||||
|
self.process.Kill()
|
||||||
|
|
||||||
def executeStepI(self, _ = None):
|
def executeStepI(self, _ = None):
|
||||||
self.currentThread().StepInstruction(lldb.eOnlyThisThread)
|
self.currentThread().StepInstruction(lldb.eOnlyThisThread)
|
||||||
@@ -1229,11 +1238,7 @@ class Dumper:
|
|||||||
command = args['command']
|
command = args['command']
|
||||||
self.debugger.GetCommandInterpreter().HandleCommand(command, result)
|
self.debugger.GetCommandInterpreter().HandleCommand(command, result)
|
||||||
success = result.Succeeded()
|
success = result.Succeeded()
|
||||||
if success:
|
|
||||||
output = result.GetOutput()
|
output = result.GetOutput()
|
||||||
error = ''
|
|
||||||
else:
|
|
||||||
output = ''
|
|
||||||
error = str(result.GetError())
|
error = str(result.GetError())
|
||||||
self.report('success="%d",output="%s",error="%s"' % (success, output, error))
|
self.report('success="%d",output="%s",error="%s"' % (success, output, error))
|
||||||
|
|
||||||
|
@@ -119,7 +119,7 @@ void LldbEngine::runCommand(const Command &command)
|
|||||||
void LldbEngine::shutdownInferior()
|
void LldbEngine::shutdownInferior()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(state() == InferiorShutdownRequested, qDebug() << state());
|
QTC_ASSERT(state() == InferiorShutdownRequested, qDebug() << state());
|
||||||
notifyInferiorShutdownOk();
|
runCommand(Command("shutdownInferior"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void LldbEngine::shutdownEngine()
|
void LldbEngine::shutdownEngine()
|
||||||
@@ -1018,6 +1018,14 @@ void LldbEngine::refreshState(const GdbMi &reportedState)
|
|||||||
notifyEngineRunAndInferiorRunOk();
|
notifyEngineRunAndInferiorRunOk();
|
||||||
else if (newState == "enginerunandinferiorstopok")
|
else if (newState == "enginerunandinferiorstopok")
|
||||||
notifyEngineRunAndInferiorStopOk();
|
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")
|
else if (newState == "inferiorexited")
|
||||||
notifyInferiorExited();
|
notifyInferiorExited();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user