diff options
author | hjk <[email protected]> | 2010-06-14 08:57:15 +0200 |
---|---|---|
committer | hjk <[email protected]> | 2010-06-14 10:45:11 +0200 |
commit | 97edcb7977ecea95613bf0c0e6030083549ca5f4 (patch) | |
tree | de0c5c1c3ec2e5bc6e39b5a741c59f556a71c570 /src/plugins/debugger/debuggerrunner.cpp | |
parent | a89643a83374400451674815202b73dba6a505b5 (diff) |
debugger: start 'runcontrol-ification' of the debugger plugin.
This replaces most uses of DebuggerStartParameters by DebuggerRunControl
which is a simple RunControl with a DebuggerStartParameters member.
Plan is to move all global state to the run controls, and possibly
introduce specialized ones for core debugging etc.
Diffstat (limited to 'src/plugins/debugger/debuggerrunner.cpp')
-rw-r--r-- | src/plugins/debugger/debuggerrunner.cpp | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/src/plugins/debugger/debuggerrunner.cpp b/src/plugins/debugger/debuggerrunner.cpp index 7d46177a932..a5b4fe1e2c3 100644 --- a/src/plugins/debugger/debuggerrunner.cpp +++ b/src/plugins/debugger/debuggerrunner.cpp @@ -50,7 +50,6 @@ using namespace ProjectExplorer; namespace Debugger { -namespace Internal { //////////////////////////////////////////////////////////////////////// // @@ -75,24 +74,24 @@ QString DebuggerRunControlFactory::displayName() const return tr("Debug"); } -static DebuggerStartParametersPtr localStartParameters(RunConfiguration *runConfiguration) +static DebuggerStartParameters localStartParameters(RunConfiguration *runConfiguration) { - DebuggerStartParametersPtr sp(new DebuggerStartParameters()); + DebuggerStartParameters sp; QTC_ASSERT(runConfiguration, return sp); LocalApplicationRunConfiguration *rc = qobject_cast<LocalApplicationRunConfiguration *>(runConfiguration); QTC_ASSERT(rc, return sp); - sp->startMode = StartInternal; - sp->executable = rc->executable(); - sp->environment = rc->environment().toStringList(); - sp->workingDirectory = rc->workingDirectory(); - sp->processArgs = rc->commandLineArguments(); - sp->toolChainType = rc->toolChainType(); - sp->useTerminal = rc->runMode() == LocalApplicationRunConfiguration::Console; - sp->dumperLibrary = rc->dumperLibrary(); - sp->dumperLibraryLocations = rc->dumperLibraryLocations(); - sp->displayName = rc->displayName(); + sp.startMode = StartInternal; + sp.executable = rc->executable(); + sp.environment = rc->environment().toStringList(); + sp.workingDirectory = rc->workingDirectory(); + sp.processArgs = rc->commandLineArguments(); + sp.toolChainType = rc->toolChainType(); + sp.useTerminal = rc->runMode() == LocalApplicationRunConfiguration::Console; + sp.dumperLibrary = rc->dumperLibrary(); + sp.dumperLibraryLocations = rc->dumperLibraryLocations(); + sp.displayName = rc->displayName(); // Find qtInstallPath. QString qmakePath = DebuggingHelperLibrary::findSystemQt(rc->environment()); @@ -105,7 +104,7 @@ static DebuggerStartParametersPtr localStartParameters(RunConfiguration *runConf proc.waitForFinished(); QByteArray ba = proc.readAllStandardOutput().trimmed(); QFileInfo fi(QString::fromLocal8Bit(ba) + "/.."); - sp->qtInstallPath = fi.absoluteFilePath(); + sp.qtInstallPath = fi.absoluteFilePath(); } return sp; } @@ -114,11 +113,11 @@ RunControl *DebuggerRunControlFactory::create(RunConfiguration *runConfiguration const QString &mode) { QTC_ASSERT(mode == ProjectExplorer::Constants::DEBUGMODE, return 0); - DebuggerStartParametersPtr sp = localStartParameters(runConfiguration); + DebuggerStartParameters sp = localStartParameters(runConfiguration); return new DebuggerRunControl(m_manager, sp); } -RunControl *DebuggerRunControlFactory::create(const DebuggerStartParametersPtr &sp) +RunControl *DebuggerRunControlFactory::create(const DebuggerStartParameters &sp) { return new DebuggerRunControl(m_manager, sp); } @@ -139,7 +138,7 @@ QWidget *DebuggerRunControlFactory::createConfigurationWidget(RunConfiguration * //////////////////////////////////////////////////////////////////////// DebuggerRunControl::DebuggerRunControl(DebuggerManager *manager, - const DebuggerStartParametersPtr &startParameters) + const DebuggerStartParameters &startParameters) : RunControl(0, ProjectExplorer::Constants::DEBUGMODE), m_startParameters(startParameters), m_manager(manager), @@ -159,19 +158,19 @@ DebuggerRunControl::DebuggerRunControl(DebuggerManager *manager, connect(this, SIGNAL(stopRequested()), m_manager, SLOT(exitDebugger())); - if (m_startParameters->environment.empty()) - m_startParameters->environment = ProjectExplorer::Environment().toStringList(); - m_startParameters->useTerminal = false; + if (m_startParameters.environment.empty()) + m_startParameters.environment = ProjectExplorer::Environment().toStringList(); + m_startParameters.useTerminal = false; } QString DebuggerRunControl::displayName() const { - return m_startParameters->displayName; + return m_startParameters.displayName; } void DebuggerRunControl::setCustomEnvironment(ProjectExplorer::Environment env) { - m_startParameters->environment = env.toStringList(); + m_startParameters.environment = env.toStringList(); } void DebuggerRunControl::init() @@ -184,9 +183,9 @@ void DebuggerRunControl::start() QString errorMessage; QString settingsCategory; QString settingsPage; - if (m_manager->checkDebugConfiguration(m_startParameters->toolChainType, &errorMessage, + if (m_manager->checkDebugConfiguration(m_startParameters.toolChainType, &errorMessage, &settingsCategory, &settingsPage)) { - m_manager->startNewDebugger(m_startParameters); + m_manager->startNewDebugger(this); emit started(); } else { appendMessage(this, errorMessage, true); @@ -225,5 +224,4 @@ bool DebuggerRunControl::isRunning() const return m_running; } -} // namespace Internal } // namespace Debugger |