Debugger: Fail more gracefully on "ill" LLDB engines

Less need to use the hard Debug->Abort

Change-Id: Ib019792063924549ace58a63ccef994dbfaa00dc
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
hjk
2014-06-02 16:45:12 +02:00
parent 99271c2343
commit 60f5b5afc5
2 changed files with 12 additions and 1 deletions

View File

@@ -1195,6 +1195,9 @@ class Dumper(DumperBase):
else:
error = self.process.Continue()
self.reportError(error)
# Happens when attaching to GDBserver.
if not error.Success():
self.reportState("inferiorill")
def quitDebugger(self, _ = None):
self.reportState("inferiorshutdownrequested")
@@ -1451,7 +1454,13 @@ class Dumper(DumperBase):
def shutdownInferior(self, _ = None):
self.isShuttingDown_ = True
self.process.Kill()
if self.process is None:
self.reportState("inferiorshutdownok")
else:
state = self.process.GetState()
if state == lldb.eStateStopped:
self.process.Kill()
self.reportState("inferiorshutdownok")
def quit(self, _ = None):
self.reportState("engineshutdownok")

View File

@@ -1216,6 +1216,8 @@ void LldbEngine::refreshState(const GdbMi &reportedState)
notifyInferiorStopOk();
else if (newState == "inferiorstopfailed")
notifyInferiorStopFailed();
else if (newState == "inferiorill")
notifyInferiorIll();
else if (newState == "enginesetupok")
notifyEngineSetupOk();
else if (newState == "enginesetupfailed")