forked from qt-creator/qt-creator
Debugger: Fix attaching to core for LLDB
Task-number: QTCREATORBUG-18722 Change-Id: I4579fff9725f4a7578642080a010ca54b221969b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -908,7 +908,10 @@ class Dumper(DumperBase):
|
|||||||
elif self.startMode_ == AttachCore:
|
elif self.startMode_ == AttachCore:
|
||||||
coreFile = args.get('coreFile', '');
|
coreFile = args.get('coreFile', '');
|
||||||
self.process = self.target.LoadCore(coreFile)
|
self.process = self.target.LoadCore(coreFile)
|
||||||
|
if self.process.IsValid():
|
||||||
self.reportState('enginerunokandinferiorunrunnable')
|
self.reportState('enginerunokandinferiorunrunnable')
|
||||||
|
else:
|
||||||
|
self.reportState('enginerunfailed')
|
||||||
else:
|
else:
|
||||||
launchInfo = lldb.SBLaunchInfo(self.processArgs_)
|
launchInfo = lldb.SBLaunchInfo(self.processArgs_)
|
||||||
launchInfo.SetWorkingDirectory(self.workingDirectory_)
|
launchInfo.SetWorkingDirectory(self.workingDirectory_)
|
||||||
|
|||||||
@@ -157,6 +157,15 @@ void LldbEngine::debugLastCommand()
|
|||||||
runCommand(m_lastDebuggableCommand);
|
runCommand(m_lastDebuggableCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LldbEngine::handleAttachedToCore()
|
||||||
|
{
|
||||||
|
QTC_ASSERT(state() == InferiorUnrunnable, qDebug() << state();return);
|
||||||
|
showMessage("Attached to core.");
|
||||||
|
reloadFullStack();
|
||||||
|
reloadModules();
|
||||||
|
updateLocals();
|
||||||
|
}
|
||||||
|
|
||||||
void LldbEngine::shutdownInferior()
|
void LldbEngine::shutdownInferior()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(state() == InferiorShutdownRequested, qDebug() << state());
|
QTC_ASSERT(state() == InferiorShutdownRequested, qDebug() << state());
|
||||||
@@ -851,9 +860,11 @@ void LldbEngine::handleStateNotification(const GdbMi &reportedState)
|
|||||||
} else if (newState == "enginerunandinferiorstopok") {
|
} else if (newState == "enginerunandinferiorstopok") {
|
||||||
notifyEngineRunAndInferiorStopOk();
|
notifyEngineRunAndInferiorStopOk();
|
||||||
continueInferior();
|
continueInferior();
|
||||||
} else if (newState == "enginerunokandinferiorunrunnable")
|
} else if (newState == "enginerunokandinferiorunrunnable") {
|
||||||
notifyEngineRunOkAndInferiorUnrunnable();
|
notifyEngineRunOkAndInferiorUnrunnable();
|
||||||
else if (newState == "inferiorshutdownfinished")
|
if (runParameters().startMode == AttachCore)
|
||||||
|
handleAttachedToCore();
|
||||||
|
} else if (newState == "inferiorshutdownfinished")
|
||||||
notifyInferiorShutdownFinished();
|
notifyInferiorShutdownFinished();
|
||||||
else if (newState == "engineshutdownfinished")
|
else if (newState == "engineshutdownfinished")
|
||||||
notifyEngineShutdownFinished();
|
notifyEngineShutdownFinished();
|
||||||
|
|||||||
@@ -136,6 +136,7 @@ private:
|
|||||||
|
|
||||||
void runCommand(const DebuggerCommand &cmd) override;
|
void runCommand(const DebuggerCommand &cmd) override;
|
||||||
void debugLastCommand() override;
|
void debugLastCommand() override;
|
||||||
|
void handleAttachedToCore();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DebuggerCommand m_lastDebuggableCommand;
|
DebuggerCommand m_lastDebuggableCommand;
|
||||||
|
|||||||
Reference in New Issue
Block a user