Debugger: Merge GdbEngine's {run,post,flush}Command

Since we don't keep a local queue anymore, the distinction is
no more needed. Also, this is close to the LLDB side now.

Also move remaining uses of DebuggerCommand::flags to
GdbEngine, since that's the only user.

Change-Id: I61ae0f4e5294e306ab0b202e80f27fb3e3f7a7d7
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
This commit is contained in:
hjk
2015-09-11 11:28:55 +02:00
parent 25bb8411a4
commit 150af7af4c
8 changed files with 428 additions and 489 deletions

View File

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