diff --git a/src/plugins/debugger/debuggerrunner.cpp b/src/plugins/debugger/debuggerrunner.cpp index 0f9b8b2d80cdb81b69a3c6ea050e4849112ee497..75b76845e8b54e866946c318bac65aff14c98f0e 100644 --- a/src/plugins/debugger/debuggerrunner.cpp +++ b/src/plugins/debugger/debuggerrunner.cpp @@ -140,39 +140,39 @@ DebuggerRunControl::DebuggerRunControl(DebuggerManager *manager, Qt::QueuedConnection); connect(this, SIGNAL(stopRequested()), m_manager, SLOT(exitDebugger())); -} - -void DebuggerRunControl::start() -{ - m_running = true; - ApplicationRunConfigurationPtr rc = - runConfiguration().objectCast<ApplicationRunConfiguration>(); - if (rc) { + if (runConfiguration) { // Enhance parameters by info from the project, but do not clobber // arguments given in the dialogs if (m_startParameters->executable.isEmpty()) - m_startParameters->executable = rc->executable(); + m_startParameters->executable = runConfiguration->executable(); if (m_startParameters->environment.empty()) - m_startParameters->environment = rc->environment().toStringList(); + m_startParameters->environment = runConfiguration->environment().toStringList(); if (m_startParameters->workingDir.isEmpty()) - m_startParameters->workingDir = rc->workingDirectory(); + m_startParameters->workingDir = runConfiguration->workingDirectory(); if (m_mode != StartExternal) - m_startParameters->processArgs = rc->commandLineArguments(); + m_startParameters->processArgs = runConfiguration->commandLineArguments(); switch (m_startParameters->toolChainType) { case ProjectExplorer::ToolChain::UNKNOWN: case ProjectExplorer::ToolChain::INVALID: - m_startParameters->toolChainType = rc->toolChainType(); + m_startParameters->toolChainType = runConfiguration->toolChainType(); break; default: break; } - m_manager->setQtDumperLibraryName(rc->dumperLibrary()); - m_manager->setQtDumperLibraryLocations(rc->dumperLibraryLocations()); - if (const ProjectExplorer::Project *project = rc->project()) { + if (const ProjectExplorer::Project *project = runConfiguration->project()) { m_startParameters->buildDir = project->buildDirectory(project->activeBuildConfiguration()); } - m_startParameters->useTerminal = rc->runMode() == ApplicationRunConfiguration::Console; + m_startParameters->useTerminal = runConfiguration->runMode() == ApplicationRunConfiguration::Console; + m_dumperLibrary = runConfiguration->dumperLibrary(); + m_dumperLibraryLocations = runConfiguration->dumperLibraryLocations(); } +} + +void DebuggerRunControl::start() +{ + m_running = true; + m_manager->setQtDumperLibraryName(m_dumperLibrary); + m_manager->setQtDumperLibraryLocations(m_dumperLibraryLocations); //emit addToOutputWindow(this, tr("Debugging %1").arg(m_executable)); m_manager->startNewDebugger(this, m_startParameters); diff --git a/src/plugins/debugger/debuggerrunner.h b/src/plugins/debugger/debuggerrunner.h index 0e0b0ac1e77702e48310f6a7ea429f2caddca978..06a986ce9d329af08dcbec44b5debf4204602899 100644 --- a/src/plugins/debugger/debuggerrunner.h +++ b/src/plugins/debugger/debuggerrunner.h @@ -109,6 +109,8 @@ private: const QSharedPointer<DebuggerStartParameters> m_startParameters; DebuggerManager *m_manager; bool m_running; + QString m_dumperLibrary; + QStringList m_dumperLibraryLocations; }; // A default run configuration for external executables or attaching to