diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py index 5a8290b3d20..f7b9d8a0ef7 100644 --- a/share/qtcreator/debugger/lldbbridge.py +++ b/share/qtcreator/debugger/lldbbridge.py @@ -908,7 +908,10 @@ class Dumper(DumperBase): elif self.startMode_ == AttachCore: coreFile = args.get('coreFile', ''); self.process = self.target.LoadCore(coreFile) - self.reportState('enginerunokandinferiorunrunnable') + if self.process.IsValid(): + self.reportState('enginerunokandinferiorunrunnable') + else: + self.reportState('enginerunfailed') else: launchInfo = lldb.SBLaunchInfo(self.processArgs_) launchInfo.SetWorkingDirectory(self.workingDirectory_) diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp index 6e26ff3e6e8..80f2fd411c5 100644 --- a/src/plugins/debugger/lldb/lldbengine.cpp +++ b/src/plugins/debugger/lldb/lldbengine.cpp @@ -157,6 +157,15 @@ void LldbEngine::debugLastCommand() runCommand(m_lastDebuggableCommand); } +void LldbEngine::handleAttachedToCore() +{ + QTC_ASSERT(state() == InferiorUnrunnable, qDebug() << state();return); + showMessage("Attached to core."); + reloadFullStack(); + reloadModules(); + updateLocals(); +} + void LldbEngine::shutdownInferior() { QTC_ASSERT(state() == InferiorShutdownRequested, qDebug() << state()); @@ -851,9 +860,11 @@ void LldbEngine::handleStateNotification(const GdbMi &reportedState) } else if (newState == "enginerunandinferiorstopok") { notifyEngineRunAndInferiorStopOk(); continueInferior(); - } else if (newState == "enginerunokandinferiorunrunnable") + } else if (newState == "enginerunokandinferiorunrunnable") { notifyEngineRunOkAndInferiorUnrunnable(); - else if (newState == "inferiorshutdownfinished") + if (runParameters().startMode == AttachCore) + handleAttachedToCore(); + } else if (newState == "inferiorshutdownfinished") notifyInferiorShutdownFinished(); else if (newState == "engineshutdownfinished") notifyEngineShutdownFinished(); diff --git a/src/plugins/debugger/lldb/lldbengine.h b/src/plugins/debugger/lldb/lldbengine.h index 46a4b745785..f52cf3dd99d 100644 --- a/src/plugins/debugger/lldb/lldbengine.h +++ b/src/plugins/debugger/lldb/lldbengine.h @@ -136,6 +136,7 @@ private: void runCommand(const DebuggerCommand &cmd) override; void debugLastCommand() override; + void handleAttachedToCore(); private: DebuggerCommand m_lastDebuggableCommand;