Debugger: Make DebuggerEngine::runCommand() virtual.

Allows default implementation of e.g. stack retrieval in the base
class.

Change-Id: I96460b19aa31347b2c863736b4ce2b5046eb4de6
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
This commit is contained in:
hjk
2015-11-03 12:01:57 +01:00
parent 3febe4e7a2
commit 2b16b97f19
17 changed files with 252 additions and 318 deletions

View File

@@ -212,9 +212,8 @@ void GdbCoreEngine::setupInferior()
// Do that first, otherwise no symbols are loaded.
QFileInfo fi(m_executable);
QByteArray path = fi.absoluteFilePath().toLocal8Bit();
DebuggerCommand cmd("-file-exec-and-symbols \"" + path + '"');
cmd.callback = CB(handleFileExecAndSymbols);
runCommand(cmd);
runCommand({"-file-exec-and-symbols \"" + path + '"', NoFlags,
CB(handleFileExecAndSymbols)});
}
void GdbCoreEngine::handleFileExecAndSymbols(const DebuggerResponse &response)
@@ -237,9 +236,8 @@ void GdbCoreEngine::handleFileExecAndSymbols(const DebuggerResponse &response)
void GdbCoreEngine::runEngine()
{
CHECK_STATE(EngineRunRequested);
DebuggerCommand cmd("target core " + coreFileName().toLocal8Bit());
cmd.callback = CB(handleTargetCore);
runCommand(cmd);
runCommand({"target core " + coreFileName().toLocal8Bit(), NoFlags,
CB(handleTargetCore)});
}
void GdbCoreEngine::handleTargetCore(const DebuggerResponse &response)
@@ -252,7 +250,7 @@ void GdbCoreEngine::handleTargetCore(const DebuggerResponse &response)
// symbols yet. Load them in order of importance.
reloadStack();
reloadModulesInternal();
runCommand("p 5", CB(handleRoundTrip));
runCommand({"p 5", NoFlags, CB(handleRoundTrip)});
return;
}
showStatusMessage(tr("Attach to core \"%1\" failed:").arg(runParameters().coreFile)