diff options
author | hjk <hjk@theqtcompany.com> | 2016-01-28 10:31:24 +0100 |
---|---|---|
committer | hjk <hjk@theqtcompany.com> | 2016-01-28 14:15:54 +0000 |
commit | 2cf006059614a033fe3ff6d63bfa39c062514633 (patch) | |
tree | 2c731e5ae9b2c66bb526a0e413780e202f8633d3 /src/plugins/debugger | |
parent | 67e952e888dcb43466a031015e1917890c640470 (diff) | |
download | qt-creator-2cf006059614a033fe3ff6d63bfa39c062514633.tar.gz |
Debugger: Use StandardRunnable in DebuggerStartParameters
This is a mechanical replacement for the former executable, processArgs,
inferiorEnvironment and workingDirectory members.
Change-Id: I4160e01427ed801df9b729f1f31d0a2ca48159b5
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Diffstat (limited to 'src/plugins/debugger')
-rw-r--r-- | src/plugins/debugger/cdb/cdbengine.cpp | 27 | ||||
-rw-r--r-- | src/plugins/debugger/debuggerdialogs.cpp | 6 | ||||
-rw-r--r-- | src/plugins/debugger/debuggerengine.cpp | 16 | ||||
-rw-r--r-- | src/plugins/debugger/debuggerplugin.cpp | 24 | ||||
-rw-r--r-- | src/plugins/debugger/debuggerruncontrol.cpp | 35 | ||||
-rw-r--r-- | src/plugins/debugger/debuggersourcepathmappingwidget.cpp | 2 | ||||
-rw-r--r-- | src/plugins/debugger/debuggerstartparameters.h | 8 | ||||
-rw-r--r-- | src/plugins/debugger/gdb/attachgdbadapter.cpp | 4 | ||||
-rw-r--r-- | src/plugins/debugger/gdb/coregdbadapter.cpp | 2 | ||||
-rw-r--r-- | src/plugins/debugger/gdb/gdbengine.cpp | 11 | ||||
-rw-r--r-- | src/plugins/debugger/gdb/gdbplainengine.cpp | 10 | ||||
-rw-r--r-- | src/plugins/debugger/gdb/remotegdbserveradapter.cpp | 14 | ||||
-rw-r--r-- | src/plugins/debugger/gdb/startgdbserverdialog.cpp | 2 | ||||
-rw-r--r-- | src/plugins/debugger/gdb/termgdbadapter.cpp | 6 | ||||
-rw-r--r-- | src/plugins/debugger/lldb/lldbengine.cpp | 28 | ||||
-rw-r--r-- | src/plugins/debugger/pdb/pdbengine.cpp | 2 | ||||
-rw-r--r-- | src/plugins/debugger/qml/qmlengine.cpp | 6 | ||||
-rw-r--r-- | src/plugins/debugger/snapshothandler.cpp | 2 |
18 files changed, 100 insertions, 105 deletions
diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index 7d28dfbe79..f9317178bb 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -409,7 +409,7 @@ int CdbEngine::elapsedLogTime() const bool CdbEngine::startConsole(const DebuggerRunParameters &sp, QString *errorMessage) { if (debug) - qDebug("startConsole %s", qPrintable(sp.executable)); + qDebug("startConsole %s", qPrintable(sp.inferior.executable)); m_consoleStub.reset(new ConsoleProcess); m_consoleStub->setMode(ConsoleProcess::Suspend); connect(m_consoleStub.data(), &ConsoleProcess::processError, @@ -418,11 +418,11 @@ bool CdbEngine::startConsole(const DebuggerRunParameters &sp, QString *errorMess this, &CdbEngine::consoleStubProcessStarted); connect(m_consoleStub.data(), &ConsoleProcess::stubStopped, this, &CdbEngine::consoleStubExited); - m_consoleStub->setWorkingDirectory(sp.workingDirectory); + m_consoleStub->setWorkingDirectory(sp.inferior.workingDirectory); if (sp.stubEnvironment.size()) m_consoleStub->setEnvironment(sp.stubEnvironment); - if (!m_consoleStub->start(sp.executable, sp.processArgs)) { - *errorMessage = tr("The console process \"%1\" could not be started.").arg(sp.executable); + if (!m_consoleStub->start(sp.inferior.executable, sp.inferior.commandLineArguments)) { + *errorMessage = tr("The console process \"%1\" could not be started.").arg(sp.inferior.executable); return false; } return true; @@ -448,8 +448,8 @@ void CdbEngine::consoleStubProcessStarted() qDebug("consoleStubProcessStarted() PID=%lld", m_consoleStub->applicationPID()); // Attach to console process. DebuggerRunParameters attachParameters = runParameters(); - attachParameters.executable.clear(); - attachParameters.processArgs.clear(); + attachParameters.inferior.executable.clear(); + attachParameters.inferior.commandLineArguments.clear(); attachParameters.attachPID = m_consoleStub->applicationPID(); attachParameters.startMode = AttachExternal; attachParameters.useTerminal = false; @@ -579,7 +579,8 @@ bool CdbEngine::launchCDB(const DebuggerRunParameters &sp, QString *errorMessage case StartExternal: if (!nativeArguments.isEmpty()) nativeArguments.push_back(blank); - QtcProcess::addArgs(&nativeArguments, QStringList(QDir::toNativeSeparators(sp.executable))); + QtcProcess::addArgs(&nativeArguments, + QStringList(QDir::toNativeSeparators(sp.inferior.executable))); break; case AttachToRemoteServer: break; @@ -600,10 +601,10 @@ bool CdbEngine::launchCDB(const DebuggerRunParameters &sp, QString *errorMessage *errorMessage = QString::fromLatin1("Internal error: Unsupported start mode %1.").arg(sp.startMode); return false; } - if (!sp.processArgs.isEmpty()) { // Complete native argument string. + if (!sp.inferior.commandLineArguments.isEmpty()) { // Complete native argument string. if (!nativeArguments.isEmpty()) nativeArguments.push_back(blank); - nativeArguments += sp.processArgs; + nativeArguments += sp.inferior.commandLineArguments; } const QString msg = QString::fromLatin1("Launching %1 %2\nusing %3 of %4."). @@ -615,12 +616,12 @@ bool CdbEngine::launchCDB(const DebuggerRunParameters &sp, QString *errorMessage m_outputBuffer.clear(); m_autoBreakPointCorrection = false; - const QStringList inferiorEnvironment = sp.inferiorEnvironment.size() == 0 ? + const QStringList inferiorEnvironment = sp.inferior.environment.size() == 0 ? QProcessEnvironment::systemEnvironment().toStringList() : - sp.inferiorEnvironment.toStringList(); + sp.inferior.environment.toStringList(); m_process.setEnvironment(mergeEnvironment(inferiorEnvironment, extensionFi.absolutePath())); - if (!sp.workingDirectory.isEmpty()) - m_process.setWorkingDirectory(sp.workingDirectory); + if (!sp.inferior.workingDirectory.isEmpty()) + m_process.setWorkingDirectory(sp.inferior.workingDirectory); #ifdef Q_OS_WIN if (!nativeArguments.isEmpty()) // Appends diff --git a/src/plugins/debugger/debuggerdialogs.cpp b/src/plugins/debugger/debuggerdialogs.cpp index 8e8885e845..872c0f027f 100644 --- a/src/plugins/debugger/debuggerdialogs.cpp +++ b/src/plugins/debugger/debuggerdialogs.cpp @@ -396,7 +396,7 @@ bool StartApplicationDialog::run(QWidget *parent, DebuggerRunParameters *rp, Kit settings->endGroup(); } - rp->executable = newParameters.runnable.executable; + rp->inferior.executable = newParameters.runnable.executable; const QString inputAddress = dialog.d->serverAddressEdit->text(); if (!inputAddress.isEmpty()) rp->remoteChannel = inputAddress; @@ -404,10 +404,10 @@ bool StartApplicationDialog::run(QWidget *parent, DebuggerRunParameters *rp, Kit rp->remoteChannel = rp->connParams.host; rp->remoteChannel += QLatin1Char(':') + QString::number(newParameters.serverPort); rp->displayName = newParameters.displayName(); - rp->workingDirectory = newParameters.runnable.workingDirectory; + rp->inferior.workingDirectory = newParameters.runnable.workingDirectory; rp->useTerminal = newParameters.runnable.runMode == ApplicationLauncher::Console; if (!newParameters.runnable.commandLineArguments.isEmpty()) - rp->processArgs = newParameters.runnable.commandLineArguments; + rp->inferior.commandLineArguments = newParameters.runnable.commandLineArguments; rp->breakOnMain = newParameters.breakAtMain; rp->serverStartScript = newParameters.serverStartScript; rp->debugInfoLocation = newParameters.debugInfoLocation; diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index b12631b693..9ba2a3697d 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -101,12 +101,12 @@ QDebug operator<<(QDebug d, DebuggerState state) QDebug operator<<(QDebug str, const DebuggerRunParameters &sp) { QDebug nospace = str.nospace(); - nospace << "executable=" << sp.executable + nospace << "executable=" << sp.inferior.executable << " coreFile=" << sp.coreFile - << " processArgs=" << sp.processArgs - << " inferior environment=<" << sp.inferiorEnvironment.size() << " variables>" + << " processArgs=" << sp.inferior.commandLineArguments + << " inferior environment=<" << sp.inferior.environment.size() << " variables>" << " debugger environment=<" << sp.debuggerEnvironment.size() << " variables>" - << " workingDir=" << sp.workingDirectory + << " workingDir=" << sp.inferior.workingDirectory << " attachPID=" << sp.attachPID << " useTerminal=" << sp.useTerminal << " remoteChannel=" << sp.remoteChannel @@ -206,7 +206,7 @@ public: Utils::globalMacroExpander()->registerFileVariables(PrefixDebugExecutable, tr("Debugged executable"), - [this]() { return m_runParameters.executable; }); + [this]() { return m_runParameters.inferior.executable; }); } public slots: @@ -569,7 +569,7 @@ void DebuggerEngine::startDebugger(DebuggerRunControl *runControl) d->m_runControl->setApplicationProcessHandle(ProcessHandle(d->m_inferiorPid)); if (isNativeMixedActive()) - d->m_runParameters.inferiorEnvironment.set(QLatin1String("QV4_FORCE_INTERPRETER"), QLatin1String("1")); + d->m_runParameters.inferior.environment.set(QLatin1String("QV4_FORCE_INTERPRETER"), QLatin1String("1")); action(OperateByInstruction)->setEnabled(hasCapability(DisassemblerCapability)); @@ -922,7 +922,7 @@ void DebuggerEngine::notifyEngineRemoteSetupFinished(const RemoteSetupResult &re if (result.qmlServerPort != InvalidPort) { d->m_runParameters.qmlServerPort = result.qmlServerPort; - d->m_runParameters.processArgs.replace(_("%qml_port%"), QString::number(result.qmlServerPort)); + d->m_runParameters.inferior.commandLineArguments.replace(_("%qml_port%"), QString::number(result.qmlServerPort)); } } else { @@ -1831,7 +1831,7 @@ void DebuggerEngine::validateExecutable(DebuggerRunParameters *sp) return; if (sp->languages == QmlLanguage) return; - QString binary = sp->executable; + QString binary = sp->inferior.executable; if (binary.isEmpty()) return; diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index edd6a6fb8c..49522cfb96 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -1138,8 +1138,8 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it, if (val.isEmpty()) { if (key.isEmpty()) { continue; - } else if (rp.executable.isEmpty()) { - rp.executable = key; + } else if (rp.inferior.executable.isEmpty()) { + rp.inferior.executable = key; } else { *errorMessage = DebuggerPlugin::tr("Only one executable allowed."); return false; @@ -1164,10 +1164,10 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it, } } if (rp.startMode == StartExternal) { - rp.displayName = tr("Executable file \"%1\"").arg(rp.executable); - rp.startMessage = tr("Debugging file %1.").arg(rp.executable); + rp.displayName = tr("Executable file \"%1\"").arg(rp.inferior.executable); + rp.startMessage = tr("Debugging file %1.").arg(rp.inferior.executable); } - rp.inferiorEnvironment = Utils::Environment::systemEnvironment(); + rp.inferior.environment = Utils::Environment::systemEnvironment(); rp.stubEnvironment = Utils::Environment::systemEnvironment(); rp.debuggerEnvironment = Utils::Environment::systemEnvironment(); m_scheduledStarts.append(QPair<DebuggerRunParameters, Kit *>(rp, kit)); @@ -1331,7 +1331,7 @@ void DebuggerPluginPrivate::attachCore() QString display = dlg.useLocalCoreFile() ? dlg.localCoreFile() : dlg.remoteCoreFile(); DebuggerRunParameters rp; rp.masterEngineType = DebuggerKitInformation::engineType(dlg.kit()); - rp.executable = dlg.localExecutableFile(); + rp.inferior.executable = dlg.localExecutableFile(); rp.coreFile = dlg.localCoreFile(); rp.displayName = tr("Core file \"%1\"").arg(display); rp.startMode = AttachCore; @@ -1467,7 +1467,7 @@ DebuggerRunControl *DebuggerPluginPrivate::attachToRunningProcess(Kit *kit, DebuggerRunParameters rp; rp.attachPID = process.pid; rp.displayName = tr("Process %1").arg(process.pid); - rp.executable = process.exe; + rp.inferior.executable = process.exe; rp.startMode = AttachExternal; rp.closeMode = DetachAtClose; rp.continueAfterAttach = contAfterAttach; @@ -2239,14 +2239,14 @@ static QString formatStartParameters(DebuggerRunParameters &sp) if (sp.languages & QmlLanguage) str << "qml"; str << '\n'; - if (!sp.executable.isEmpty()) { - str << "Executable: " << QDir::toNativeSeparators(sp.executable) - << ' ' << sp.processArgs; + if (!sp.inferior.executable.isEmpty()) { + str << "Executable: " << QDir::toNativeSeparators(sp.inferior.executable) + << ' ' << sp.inferior.commandLineArguments; if (sp.useTerminal) str << " [terminal]"; str << '\n'; - if (!sp.workingDirectory.isEmpty()) - str << "Directory: " << QDir::toNativeSeparators(sp.workingDirectory) + if (!sp.inferior.workingDirectory.isEmpty()) + str << "Directory: " << QDir::toNativeSeparators(sp.inferior.workingDirectory) << '\n'; } QString cmd = sp.debuggerCommand; diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index 9f04610e97..1f46d88f48 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -146,7 +146,7 @@ void DebuggerRunControl::start() QTC_ASSERT(m_engine, return); // User canceled input dialog asking for executable when working on library project. if (m_engine->runParameters().startMode == StartInternal - && m_engine->runParameters().executable.isEmpty() + && m_engine->runParameters().inferior.executable.isEmpty() && m_engine->runParameters().interpreter.isEmpty()) { appendMessage(tr("No executable specified.") + QLatin1Char('\n'), ErrorMessageFormat); emit started(); @@ -333,11 +333,11 @@ void DebuggerRunControlCreator::enrich(const RunConfiguration *runConfig, const // Extract as much as possible from available RunConfiguration. if (m_runConfig->runnable().is<StandardRunnable>()) { auto runnable = m_runConfig->runnable().as<StandardRunnable>(); - m_rp.executable = runnable.executable; - m_rp.processArgs = runnable.commandLineArguments; + m_rp.inferior.executable = runnable.executable; + m_rp.inferior.commandLineArguments = runnable.commandLineArguments; m_rp.useTerminal = runnable.runMode == ApplicationLauncher::Console; // Normalize to work around QTBUG-17529 (QtDeclarative fails with 'File name case mismatch'...) - m_rp.workingDirectory = FileUtils::normalizePathName(runnable.workingDirectory); + m_rp.inferior.workingDirectory = FileUtils::normalizePathName(runnable.workingDirectory); } // Find a Kit and Target. Either could be missing. @@ -353,10 +353,10 @@ void DebuggerRunControlCreator::enrich(const RunConfiguration *runConfig, const } // We might get an executable from a local PID. - if (m_rp.executable.isEmpty() && m_rp.attachPID != InvalidPid) { + if (m_rp.inferior.executable.isEmpty() && m_rp.attachPID != InvalidPid) { foreach (const DeviceProcessItem &p, DeviceProcessList::localProcesses()) if (p.pid == m_rp.attachPID) - m_rp.executable = p.exe; + m_rp.inferior.executable = p.exe; } if (!m_kit) { @@ -366,8 +366,8 @@ void DebuggerRunControlCreator::enrich(const RunConfiguration *runConfig, const QList<Abi> abis; if (m_rp.toolChainAbi.isValid()) { abis.push_back(m_rp.toolChainAbi); - } else if (!m_rp.executable.isEmpty()) { - abis = Abi::abisOfBinary(FileName::fromString(m_rp.executable)); + } else if (!m_rp.inferior.executable.isEmpty()) { + abis = Abi::abisOfBinary(FileName::fromString(m_rp.inferior.executable)); } if (!abis.isEmpty()) { @@ -401,9 +401,9 @@ void DebuggerRunControlCreator::enrich(const RunConfiguration *runConfig, const if (m_runConfig) { if (auto envAspect = m_runConfig->extraAspect<EnvironmentAspect>()) { - m_rp.inferiorEnvironment = envAspect->environment(); // Correct. - m_rp.stubEnvironment = m_rp.inferiorEnvironment; // FIXME: Wrong, but contains DYLD_IMAGE_SUFFIX - m_rp.debuggerEnvironment = m_rp.inferiorEnvironment; // FIXME: Wrong, but contains DYLD_IMAGE_SUFFIX + m_rp.inferior.environment = envAspect->environment(); // Correct. + m_rp.stubEnvironment = m_rp.inferior.environment; // FIXME: Wrong, but contains DYLD_IMAGE_SUFFIX + m_rp.debuggerEnvironment = m_rp.inferior.environment; // FIXME: Wrong, but contains DYLD_IMAGE_SUFFIX } } @@ -466,9 +466,9 @@ void DebuggerRunControlCreator::enrich(const RunConfiguration *runConfig, const m_rp.interpreter = interpreter; QString args = runConfig->property("arguments").toString(); if (!args.isEmpty()) { - if (!m_rp.processArgs.isEmpty()) - m_rp.processArgs.append(QLatin1Char(' ')); - m_rp.processArgs.append(args); + if (!m_rp.inferior.commandLineArguments.isEmpty()) + m_rp.inferior.commandLineArguments.append(QLatin1Char(' ')); + m_rp.inferior.commandLineArguments.append(args); } m_rp.masterEngineType = PdbEngineType; } @@ -496,8 +496,8 @@ void DebuggerRunControlCreator::enrich(const RunConfiguration *runConfig, const // Makes sure that all bindings go through the JavaScript engine, so that // breakpoints are actually hit! const QString optimizerKey = _("QML_DISABLE_OPTIMIZER"); - if (!m_rp.inferiorEnvironment.hasKey(optimizerKey)) - m_rp.inferiorEnvironment.set(optimizerKey, _("1")); + if (!m_rp.inferior.environment.hasKey(optimizerKey)) + m_rp.inferior.environment.set(optimizerKey, _("1")); } } } @@ -532,7 +532,8 @@ void DebuggerRunControlCreator::enrich(const RunConfiguration *runConfig, const service = QmlDebug::QmlDebuggerServices; } if (m_rp.startMode != AttachExternal) - QtcProcess::addArg(&m_rp.processArgs, wantCppDebugger && m_rp.nativeMixedEnabled ? + QtcProcess::addArg(&m_rp.inferior.commandLineArguments, + wantCppDebugger && m_rp.nativeMixedEnabled ? QmlDebug::qmlDebugNativeArguments(service, false) : QmlDebug::qmlDebugTcpArguments(service, m_rp.qmlServerPort)); } diff --git a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp index 4d3efa0953..535a2fda72 100644 --- a/src/plugins/debugger/debuggersourcepathmappingwidget.cpp +++ b/src/plugins/debugger/debuggersourcepathmappingwidget.cpp @@ -435,7 +435,7 @@ DebuggerSourcePathMappingWidget::SourcePathMap DebuggerSourcePathMappingWidget::mergePlatformQtPath(const DebuggerRunParameters &sp, const SourcePathMap &in) { - const FileName qmake = BuildableHelperLibrary::findSystemQt(sp.inferiorEnvironment); + const FileName qmake = BuildableHelperLibrary::findSystemQt(sp.inferior.environment); // FIXME: Get this from the profile? // We could query the QtVersion for this information directly, but then we // will need to add a dependency on QtSupport to the debugger. diff --git a/src/plugins/debugger/debuggerstartparameters.h b/src/plugins/debugger/debuggerstartparameters.h index cd6a389bc6..fafeabc56d 100644 --- a/src/plugins/debugger/debuggerstartparameters.h +++ b/src/plugins/debugger/debuggerstartparameters.h @@ -33,6 +33,7 @@ #include <utils/environment.h> #include <projectexplorer/abi.h> #include <projectexplorer/runconfiguration.h> +#include <projectexplorer/runnables.h> #include <projectexplorer/devicesupport/idevice.h> #include <QMetaType> @@ -60,18 +61,13 @@ public: class DEBUGGER_EXPORT DebuggerStartParameters { public: - DebuggerStartParameters() {} - DebuggerStartMode startMode = NoStartMode; DebuggerCloseMode closeMode = KillAtClose; - QString executable; + ProjectExplorer::StandardRunnable inferior; QString displayName; // Used in the Snapshots view. - QString processArgs; - Utils::Environment inferiorEnvironment; Utils::Environment debuggerEnvironment; Utils::Environment stubEnvironment; - QString workingDirectory; qint64 attachPID = InvalidPid; QStringList solibSearchPath; bool useTerminal = false; diff --git a/src/plugins/debugger/gdb/attachgdbadapter.cpp b/src/plugins/debugger/gdb/attachgdbadapter.cpp index b21277fe72..f2bdb94a35 100644 --- a/src/plugins/debugger/gdb/attachgdbadapter.cpp +++ b/src/plugins/debugger/gdb/attachgdbadapter.cpp @@ -52,8 +52,8 @@ void GdbAttachEngine::setupEngine() QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state()); showMessage(_("TRYING TO START ADAPTER")); - if (!runParameters().workingDirectory.isEmpty()) - m_gdbProc.setWorkingDirectory(runParameters().workingDirectory); + if (!runParameters().inferior.workingDirectory.isEmpty()) + m_gdbProc.setWorkingDirectory(runParameters().inferior.workingDirectory); m_gdbProc.setEnvironment(runParameters().debuggerEnvironment); startGdb(); diff --git a/src/plugins/debugger/gdb/coregdbadapter.cpp b/src/plugins/debugger/gdb/coregdbadapter.cpp index 45ff06e576..fc6871c703 100644 --- a/src/plugins/debugger/gdb/coregdbadapter.cpp +++ b/src/plugins/debugger/gdb/coregdbadapter.cpp @@ -79,7 +79,7 @@ void GdbCoreEngine::setupEngine() showMessage(_("TRYING TO START ADAPTER")); const DebuggerRunParameters &rp = runParameters(); - m_executable = rp.executable; + m_executable = rp.inferior.executable; QFileInfo fi(rp.coreFile); m_coreName = fi.absoluteFilePath(); diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index b2af16aec5..d5e425a138 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -4082,7 +4082,7 @@ void GdbEngine::startGdb(const QStringList &args) Module module; module.startAddress = 0; module.endAddress = 0; - module.modulePath = rp.executable; + module.modulePath = rp.inferior.executable; module.moduleName = QLatin1String("<executable>"); modulesHandler()->updateModule(module); @@ -4191,7 +4191,7 @@ void GdbEngine::loadInitScript() void GdbEngine::setEnvironmentVariables() { Environment sysEnv = Environment::systemEnvironment(); - Environment runEnv = runParameters().inferiorEnvironment; + Environment runEnv = runParameters().inferior.environment; foreach (const EnvironmentItem &item, sysEnv.diff(runEnv)) { if (item.unset) runCommand({"unset environment " + item.name.toUtf8(), NoFlags}); @@ -4470,9 +4470,10 @@ bool GdbEngine::prepareCommand() if (HostOsInfo::isWindowsHost()) { DebuggerRunParameters &rp = runParameters(); QtcProcess::SplitError perr; - rp.processArgs = QtcProcess::prepareArgs(rp.processArgs, &perr, - HostOsInfo::hostOs(), - nullptr, &rp.workingDirectory).toWindowsArgs(); + rp.inferior.commandLineArguments = + QtcProcess::prepareArgs(rp.inferior.commandLineArguments, &perr, + HostOsInfo::hostOs(), nullptr, + &rp.inferior.workingDirectory).toWindowsArgs(); if (perr != QtcProcess::SplitOk) { // perr == BadQuoting is never returned on Windows // FIXME? QTCREATORBUG-2809 diff --git a/src/plugins/debugger/gdb/gdbplainengine.cpp b/src/plugins/debugger/gdb/gdbplainengine.cpp index 9668797b15..a04a17aa48 100644 --- a/src/plugins/debugger/gdb/gdbplainengine.cpp +++ b/src/plugins/debugger/gdb/gdbplainengine.cpp @@ -53,8 +53,8 @@ void GdbPlainEngine::setupInferior() { QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state()); setEnvironmentVariables(); - if (!runParameters().processArgs.isEmpty()) { - QString args = runParameters().processArgs; + if (!runParameters().inferior.commandLineArguments.isEmpty()) { + QString args = runParameters().inferior.commandLineArguments; runCommand({"-exec-arguments " + toLocalEncoding(args), NoFlags}); } runCommand({"-file-exec-and-symbols \"" + execFilePath() + '"', NoFlags, @@ -120,8 +120,8 @@ void GdbPlainEngine::setupEngine() } gdbArgs.append(_("--tty=") + m_outputCollector.serverName()); - if (!runParameters().workingDirectory.isEmpty()) - m_gdbProc.setWorkingDirectory(runParameters().workingDirectory); + if (!runParameters().inferior.workingDirectory.isEmpty()) + m_gdbProc.setWorkingDirectory(runParameters().inferior.workingDirectory); startGdb(gdbArgs); } @@ -145,7 +145,7 @@ void GdbPlainEngine::shutdownEngine() QByteArray GdbPlainEngine::execFilePath() const { - return QFileInfo(runParameters().executable) + return QFileInfo(runParameters().inferior.executable) .absoluteFilePath().toLocal8Bit(); } diff --git a/src/plugins/debugger/gdb/remotegdbserveradapter.cpp b/src/plugins/debugger/gdb/remotegdbserveradapter.cpp index b63fbd10a6..bf92900bf9 100644 --- a/src/plugins/debugger/gdb/remotegdbserveradapter.cpp +++ b/src/plugins/debugger/gdb/remotegdbserveradapter.cpp @@ -79,14 +79,14 @@ void GdbRemoteServerEngine::setupEngine() // Provide script information about the environment QString arglist; QtcProcess::addArg(&arglist, serverStartScript); - QtcProcess::addArg(&arglist, runParameters().executable); + QtcProcess::addArg(&arglist, runParameters().inferior.executable); QtcProcess::addArg(&arglist, runParameters().remoteChannel); m_uploadProc.start(arglist); m_uploadProc.waitForStarted(); } - if (!runParameters().workingDirectory.isEmpty()) - m_gdbProc.setWorkingDirectory(runParameters().workingDirectory); + if (!runParameters().inferior.workingDirectory.isEmpty()) + m_gdbProc.setWorkingDirectory(runParameters().inferior.workingDirectory); if (runParameters().remoteSetupNeeded) { notifyEngineRequestRemoteSetup(); @@ -164,15 +164,15 @@ void GdbRemoteServerEngine::setupInferior() QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state()); const DebuggerRunParameters &rp = runParameters(); QString executableFileName; - if (!rp.executable.isEmpty()) { - QFileInfo fi(rp.executable); + if (!rp.inferior.executable.isEmpty()) { + QFileInfo fi(rp.inferior.executable); executableFileName = fi.absoluteFilePath(); } //const QByteArray sysroot = sp.sysroot.toLocal8Bit(); //const QByteArray remoteArch = sp.remoteArchitecture.toLatin1(); - const QString args = isMasterEngine() ? runParameters().processArgs - : masterEngine()->runParameters().processArgs; + const QString args = isMasterEngine() ? runParameters().inferior.commandLineArguments + : masterEngine()->runParameters().inferior.commandLineArguments; // if (!remoteArch.isEmpty()) // postCommand("set architecture " + remoteArch); diff --git a/src/plugins/debugger/gdb/startgdbserverdialog.cpp b/src/plugins/debugger/gdb/startgdbserverdialog.cpp index 4f81ff242d..cb17291f4e 100644 --- a/src/plugins/debugger/gdb/startgdbserverdialog.cpp +++ b/src/plugins/debugger/gdb/startgdbserverdialog.cpp @@ -213,7 +213,7 @@ void GdbServerStarter::attach(int port) rp.connParams.port = port; rp.remoteChannel = rp.connParams.host + QLatin1Char(':') + QString::number(rp.connParams.port); rp.displayName = tr("Remote: \"%1:%2\"").arg(rp.connParams.host).arg(port); - rp.executable = localExecutable; + rp.inferior.executable = localExecutable; rp.startMode = AttachToRemoteServer; rp.closeMode = KillAtClose; createAndScheduleRun(rp, d->kit); diff --git a/src/plugins/debugger/gdb/termgdbadapter.cpp b/src/plugins/debugger/gdb/termgdbadapter.cpp index 65f06999d7..60019e7efb 100644 --- a/src/plugins/debugger/gdb/termgdbadapter.cpp +++ b/src/plugins/debugger/gdb/termgdbadapter.cpp @@ -81,7 +81,7 @@ void GdbTermEngine::setupEngine() if (!prepareCommand()) return; - m_stubProc.setWorkingDirectory(runParameters().workingDirectory); + m_stubProc.setWorkingDirectory(runParameters().inferior.workingDirectory); // Set environment + dumper preload. m_stubProc.setEnvironment(runParameters().stubEnvironment); @@ -94,8 +94,8 @@ void GdbTermEngine::setupEngine() // FIXME: Starting the stub implies starting the inferior. This is // fairly unclean as far as the state machine and error reporting go. - if (!m_stubProc.start(runParameters().executable, - runParameters().processArgs)) { + if (!m_stubProc.start(runParameters().inferior.executable, + runParameters().inferior.commandLineArguments)) { // Error message for user is delivered via a signal. handleAdapterStartFailed(QString()); return; diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp index ccc6414cbc..39eee535ec 100644 --- a/src/plugins/debugger/lldb/lldbengine.cpp +++ b/src/plugins/debugger/lldb/lldbengine.cpp @@ -177,9 +177,9 @@ bool LldbEngine::prepareCommand() if (HostOsInfo::isWindowsHost()) { DebuggerRunParameters &rp = runParameters(); QtcProcess::SplitError perr; - rp.processArgs = QtcProcess::prepareArgs(rp.processArgs, &perr, - HostOsInfo::hostOs(), - nullptr, &rp.workingDirectory).toWindowsArgs(); + rp.inferior.commandLineArguments + = QtcProcess::prepareArgs(rp.inferior.commandLineArguments, &perr, HostOsInfo::hostOs(), + nullptr, &rp.inferior.workingDirectory).toWindowsArgs(); if (perr != QtcProcess::SplitOk) { // perr == BadQuoting is never returned on Windows // FIXME? QTCREATORBUG-2809 @@ -207,7 +207,7 @@ void LldbEngine::setupEngine() return; } - m_stubProc.setWorkingDirectory(runParameters().workingDirectory); + m_stubProc.setWorkingDirectory(runParameters().inferior.workingDirectory); // Set environment + dumper preload. m_stubProc.setEnvironment(runParameters().stubEnvironment); @@ -217,8 +217,8 @@ void LldbEngine::setupEngine() // FIXME: Starting the stub implies starting the inferior. This is // fairly unclean as far as the state machine and error reporting go. - if (!m_stubProc.start(runParameters().executable, - runParameters().processArgs)) { + if (!m_stubProc.start(runParameters().inferior.executable, + runParameters().inferior.commandLineArguments)) { // Error message for user is delivered via a signal. //handleAdapterStartFailed(QString()); notifyEngineSetupFailed(); @@ -251,8 +251,8 @@ void LldbEngine::startLldb() showMessage(_("STARTING LLDB: ") + m_lldbCmd); m_lldbProc.setEnvironment(runParameters().debuggerEnvironment); - if (!runParameters().workingDirectory.isEmpty()) - m_lldbProc.setWorkingDirectory(runParameters().workingDirectory); + if (!runParameters().inferior.workingDirectory.isEmpty()) + m_lldbProc.setWorkingDirectory(runParameters().inferior.workingDirectory); m_lldbProc.setCommand(m_lldbCmd, QString()); m_lldbProc.start(); @@ -288,7 +288,7 @@ void LldbEngine::startLldbStage2() void LldbEngine::setupInferior() { Environment sysEnv = Environment::systemEnvironment(); - Environment runEnv = runParameters().inferiorEnvironment; + Environment runEnv = runParameters().inferior.environment; foreach (const EnvironmentItem &item, sysEnv.diff(runEnv)) { DebuggerCommand cmd("executeDebuggerCommand"); if (item.unset) @@ -322,8 +322,8 @@ void LldbEngine::setupInferior() QString executable; QtcProcess::Arguments args; - QtcProcess::prepareCommand(QFileInfo(rp.executable).absoluteFilePath(), - rp.processArgs, &executable, &args); + QtcProcess::prepareCommand(QFileInfo(rp.inferior.executable).absoluteFilePath(), + rp.inferior.commandLineArguments, &executable, &args); DebuggerCommand cmd2("setupInferior"); cmd2.arg("executable", executable); @@ -332,9 +332,9 @@ void LldbEngine::setupInferior() cmd2.arg("startmode", rp.startMode); cmd2.arg("nativemixed", isNativeMixedActive()); - cmd2.arg("dyldimagesuffix", rp.inferiorEnvironment.value(_("DYLD_IMAGE_SUFFIX"))); - cmd2.arg("dyldframeworkpath", rp.inferiorEnvironment.value(_("DYLD_LIBRARY_PATH"))); - cmd2.arg("dyldlibrarypath", rp.inferiorEnvironment.value(_("DYLD_FRAMEWORK_PATH"))); + cmd2.arg("dyldimagesuffix", rp.inferior.environment.value(_("DYLD_IMAGE_SUFFIX"))); + cmd2.arg("dyldframeworkpath", rp.inferior.environment.value(_("DYLD_LIBRARY_PATH"))); + cmd2.arg("dyldlibrarypath", rp.inferior.environment.value(_("DYLD_FRAMEWORK_PATH"))); QJsonArray processArgs; foreach (const QString &arg, args.toUnixArgs()) diff --git a/src/plugins/debugger/pdb/pdbengine.cpp b/src/plugins/debugger/pdb/pdbengine.cpp index 9ba35b9a7e..3f510f3150 100644 --- a/src/plugins/debugger/pdb/pdbengine.cpp +++ b/src/plugins/debugger/pdb/pdbengine.cpp @@ -135,7 +135,7 @@ void PdbEngine::setupEngine() } QStringList args = { bridge, scriptFile.fileName() }; - args.append(Utils::QtcProcess::splitArgs(runParameters().processArgs)); + args.append(Utils::QtcProcess::splitArgs(runParameters().inferior.workingDirectory)); showMessage(_("STARTING ") + m_interpreter + QLatin1Char(' ') + args.join(QLatin1Char(' '))); m_proc.start(m_interpreter, args); diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index c342af3b72..f6be2c4d84 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -536,11 +536,7 @@ void QmlEngine::runEngine() void QmlEngine::startApplicationLauncher() { if (!d->applicationLauncher.isRunning()) { - StandardRunnable runnable; - runnable.environment = runParameters().inferiorEnvironment; - runnable.workingDirectory = runParameters().workingDirectory; - runnable.executable = runParameters().executable; - runnable.commandLineArguments = runParameters().processArgs; + StandardRunnable runnable = runParameters().inferior; appendMessage(tr("Starting %1 %2").arg( QDir::toNativeSeparators(runnable.executable), runnable.commandLineArguments) diff --git a/src/plugins/debugger/snapshothandler.cpp b/src/plugins/debugger/snapshothandler.cpp index 26d4ba23af..7bf37a5e56 100644 --- a/src/plugins/debugger/snapshothandler.cpp +++ b/src/plugins/debugger/snapshothandler.cpp @@ -168,7 +168,7 @@ QVariant SnapshotHandler::data(const QModelIndex &index, int role) const case 0: return rp.displayName; case 1: - return rp.coreFile.isEmpty() ? rp.executable : rp.coreFile; + return rp.coreFile.isEmpty() ? rp.inferior.executable : rp.coreFile; } return QVariant(); |