Fix unstoppable debugger

For some reason sometimes a user stop request with lldb can trigger
a spontaneous stop, avoiding the debugger to stop correctly.
This change fix the issue by emitting the correct states from
lldbbridge.py.

Change-Id: Ib8a2f4875824f4fff426b2d5e0fc4a79ce48c68e
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Filipe Azevedo
2017-09-19 12:37:56 +02:00
committed by hjk
parent 76006a1353
commit 846d89811a
2 changed files with 4 additions and 4 deletions

View File

@@ -1240,9 +1240,7 @@ class Dumper(DumperBase):
if not skipEventReporting: if not skipEventReporting:
self.eventState = state self.eventState = state
if state == lldb.eStateExited: if state == lldb.eStateExited:
if self.isShuttingDown_: if not self.isShuttingDown_:
self.reportState("inferiorshutdownok")
else:
self.reportState("inferiorexited") self.reportState("inferiorexited")
self.report('exited={status="%s",desc="%s"}' self.report('exited={status="%s",desc="%s"}'
% (self.process.GetExitStatus(), self.process.GetExitDescription())) % (self.process.GetExitStatus(), self.process.GetExitDescription()))
@@ -1272,7 +1270,7 @@ class Dumper(DumperBase):
return return
if self.isInterrupting_: if self.isInterrupting_:
self.isInterrupting_ = False self.isInterrupting_ = False
self.reportState("stopped") self.reportState("inferiorstopok")
elif self.ignoreStops > 0: elif self.ignoreStops > 0:
self.ignoreStops -= 1 self.ignoreStops -= 1
self.process.Continue() self.process.Continue()

View File

@@ -910,6 +910,8 @@ void LldbEngine::handleStateNotification(const GdbMi &reportedState)
} }
} else if (newState == "inferiorstopok") { } else if (newState == "inferiorstopok") {
notifyInferiorStopOk(); notifyInferiorStopOk();
if (!isDying())
updateAll();
} else if (newState == "inferiorstopfailed") } else if (newState == "inferiorstopfailed")
notifyInferiorStopFailed(); notifyInferiorStopFailed();
else if (newState == "inferiorill") else if (newState == "inferiorill")