Commit 01cb4ee2 authored by hjk's avatar hjk
Browse files

Debugger: Fix soft assert when loading core file



Task-number: QTCREATORBUG-14048
Change-Id: I20d4d8269df3bfb42259ad459b92d5cd738332f5
Reviewed-by: default avatarChristian Stenger <christian.stenger@theqtcompany.com>
parent aee35662
......@@ -223,27 +223,29 @@ void GdbCoreEngine::handleFileExecAndSymbols(const DebuggerResponse &response)
QString core = coreFileName();
if (response.resultClass == ResultDone) {
showMessage(tr("Symbols found."), StatusBar);
postCommand("target core " + core.toLocal8Bit(), NoFlags,
CB(handleTargetCore));
return;
}
QString msg = tr("No symbols found in core file <i>%1</i>.")
.arg(core);
msg += _(" ");
msg += tr("This can be caused by a path length limitation in the "
"core file.");
msg += _(" ");
msg += tr("Try to specify the binary using the "
handleInferiorPrepared();
} else {
QString msg = tr("No symbols found in core file <i>%1</i>.").arg(core)
+ _(" ") + tr("This can be caused by a path length limitation "
"in the core file.")
+ _(" ") + tr("Try to specify the binary using the "
"<i>Debug->Start Debugging->Attach to Core</i> dialog.");
notifyInferiorSetupFailed(msg);
}
}
void GdbCoreEngine::runEngine()
{
QTC_ASSERT(state() == EngineRunRequested, qDebug() << state());
postCommand("target core " + coreFileName().toLocal8Bit(), NoFlags, CB(handleTargetCore));
}
void GdbCoreEngine::handleTargetCore(const DebuggerResponse &response)
{
QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state());
QTC_ASSERT(state() == EngineRunRequested, qDebug() << state());
notifyInferiorUnrunnable();
if (response.resultClass == ResultDone) {
showMessage(tr("Attached to core."), StatusBar);
handleInferiorPrepared();
// Due to the auto-solib-add off setting, we don't have any
// symbols yet. Load them in order of importance.
reloadStack();
......@@ -251,27 +253,19 @@ void GdbCoreEngine::handleTargetCore(const DebuggerResponse &response)
postCommand("p 5", NoFlags, CB(handleRoundTrip));
return;
}
QString msg = tr("Attach to core \"%1\" failed:")
.arg(startParameters().coreFile)
+ QLatin1Char('\n')
+ QString::fromLocal8Bit(response.data["msg"].data());
notifyInferiorSetupFailed(msg);
showStatusMessage(tr("Attach to core \"%1\" failed:").arg(startParameters().coreFile)
+ QLatin1Char('\n') + QString::fromLocal8Bit(response.data["msg"].data()));
notifyEngineIll();
}
void GdbCoreEngine::handleRoundTrip(const DebuggerResponse &response)
{
Q_UNUSED(response);
loadSymbolsForStack();
handleStop2();
QTimer::singleShot(1000, this, SLOT(loadAllSymbols()));
}
void GdbCoreEngine::runEngine()
{
QTC_ASSERT(state() == EngineRunRequested, qDebug() << state());
notifyInferiorUnrunnable();
updateAll();
}
void GdbCoreEngine::interruptInferior()
{
// A core never runs, so this cannot be called.
......
......@@ -1230,7 +1230,7 @@ void GdbEngine::executeDebuggerCommand(const QString &command, DebuggerLanguages
flushCommand(cmd);
}
// This is called from CoreAdapter and AttachAdapter.
// This is triggered when switching snapshots.
void GdbEngine::updateAll()
{
//PENDING_DEBUG("UPDATING ALL\n");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment