Debugger: Continue DebuggerStartParameter cleanup

- Move sysRoot, debuggerCommand, targetAbi to DebuggerRunParameters,
  they are always the one coming from the kit.
- Move projectSource{Directory,Files} to DebuggerRunParameters,
  they are alway coming from the runConfiguration's project
- Pass RunConfiguration always as separate parameter, that's
  what related code does.

Change-Id: I9965a052237af53fa2d170701bc88b552cab12ed
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
This commit is contained in:
hjk
2015-06-26 13:06:08 +02:00
parent f84169b51e
commit 1538dca81a
16 changed files with 90 additions and 225 deletions

View File

@@ -156,39 +156,17 @@ void MemcheckWithGdbRunControl::startDebugger()
{
const qint64 valgrindPid = runner()->valgrindProcess()->pid();
const AnalyzerStartParameters &mySp = startParameters();
Debugger::DebuggerStartParameters sp;
RunConfiguration *rc = runConfiguration();
const Target *target = rc->target();
QTC_ASSERT(target, return);
const Kit *kit = target->kit();
QTC_ASSERT(kit, return);
if (const ToolChain *tc = ToolChainKitInformation::toolChain(kit))
sp.toolChainAbi = tc->targetAbi();
if (const Project *project = target->project()) {
sp.projectSourceDirectory = project->projectDirectory().toString();
sp.projectSourceFiles = project->files(Project::ExcludeGeneratedFiles);
if (const BuildConfiguration *bc = target->activeBuildConfiguration())
sp.projectBuildDirectory = bc->buildDirectory().toString();
}
sp.executable = mySp.debuggee;
sp.sysRoot = SysRootKitInformation::sysRoot(kit).toString();
sp.debuggerCommand = Debugger::DebuggerKitInformation::debuggerCommand(kit).toString();
sp.languages |= Debugger::CppLanguage;
sp.startMode = Debugger::AttachToRemoteServer;
sp.displayName = QString::fromLatin1("VGdb %1").arg(valgrindPid);
sp.remoteChannel = QString::fromLatin1("| vgdb --pid=%1").arg(valgrindPid);
sp.useContinueInsteadOfRun = true;
sp.expectedSignals << "SIGTRAP";
sp.runConfiguration = rc;
sp.expectedSignals.append("SIGTRAP");
QString errorMessage;
RunControl *gdbRunControl = Debugger::createDebuggerRunControl(sp, &errorMessage);
RunControl *gdbRunControl = Debugger::createDebuggerRunControl(sp, runConfiguration(), &errorMessage);
QTC_ASSERT(gdbRunControl, return);
connect(gdbRunControl, &RunControl::finished,
gdbRunControl, &RunControl::deleteLater);