diff --git a/dist/changes-5.0.0.md b/dist/changes-5.0.0.md index 8bcf9440bc6..df87c466b73 100644 --- a/dist/changes-5.0.0.md +++ b/dist/changes-5.0.0.md @@ -94,6 +94,8 @@ Debugging (QTCREATORBUG-25762) * Fixed that comments in startup commands resulted in message boxes (QTCREATORBUG-25666) +* Removed extra Server Start Script field in Attach to Running Server, + use a custom deploy step instead. ### GDB diff --git a/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc b/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc index 34ecaa1785a..29f0e534af0 100644 --- a/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc +++ b/doc/qtcreator/src/debugger/creator-only/creator-debugger.qdoc @@ -405,8 +405,6 @@ applications. \li Select the \uicontrol {Break at "main"} check box to stop the debugger at the main function. - \li In the \uicontrol {Server start script} field, specify a - script file to run when the server starts. \li In the \uicontrol {Override SysRoot} field, specify the path to the \c sysroot to use instead of the default \c sysroot. \li In the \uicontrol {Init commands} field, enter the commands diff --git a/src/plugins/debugger/debuggerdialogs.cpp b/src/plugins/debugger/debuggerdialogs.cpp index 24e4b754be6..f00aca55722 100644 --- a/src/plugins/debugger/debuggerdialogs.cpp +++ b/src/plugins/debugger/debuggerdialogs.cpp @@ -85,8 +85,6 @@ public: QCheckBox *runInTerminalCheckBox; QCheckBox *useTargetExtendedRemoteCheckBox; PathChooser *debuginfoPathChooser; - QLabel *serverStartScriptLabel; - PathChooser *serverStartScriptPathChooser; QLabel *sysRootLabel; PathChooser *sysRootPathChooser; QLabel *serverInitCommandsLabel; @@ -129,7 +127,6 @@ public: bool breakAtMain = false; bool runInTerminal = false; bool useTargetExtendedRemote = false; - FilePath serverStartScript; FilePath sysRoot; QString serverInitCommands; QString serverResetCommands; @@ -144,7 +141,6 @@ bool StartApplicationParameters::equals(const StartApplicationParameters &rhs) c && runnable.workingDirectory == rhs.runnable.workingDirectory && breakAtMain == rhs.breakAtMain && runInTerminal == rhs.runInTerminal - && serverStartScript == rhs.serverStartScript && sysRoot == rhs.sysRoot && serverInitCommands == rhs.serverInitCommands && serverResetCommands == rhs.serverResetCommands @@ -184,7 +180,6 @@ void StartApplicationParameters::toSettings(QSettings *settings) const settings->setValue("LastExternalBreakAtMain", breakAtMain); settings->setValue("LastExternalRunInTerminal", runInTerminal); settings->setValue("LastExternalUseTargetExtended", useTargetExtendedRemote); - settings->setValue("LastServerStartScript", serverStartScript.toVariant()); settings->setValue("LastServerInitCommands", serverInitCommands); settings->setValue("LastServerResetCommands", serverResetCommands); settings->setValue("LastDebugInfoLocation", debugInfoLocation); @@ -202,7 +197,6 @@ void StartApplicationParameters::fromSettings(const QSettings *settings) breakAtMain = settings->value("LastExternalBreakAtMain").toBool(); runInTerminal = settings->value("LastExternalRunInTerminal").toBool(); useTargetExtendedRemote = settings->value("LastExternalUseTargetExtended").toBool(); - serverStartScript = FilePath::fromVariant(settings->value("LastServerStartScript")); serverInitCommands = settings->value("LastServerInitCommands").toString(); serverResetCommands = settings->value("LastServerResetCommands").toString(); debugInfoLocation = settings->value("LastDebugInfoLocation").toString(); @@ -260,17 +254,6 @@ StartApplicationDialog::StartApplicationDialog(QWidget *parent) d->useTargetExtendedRemoteCheckBox = new QCheckBox(this); - d->serverStartScriptPathChooser = new PathChooser(this); - d->serverStartScriptPathChooser->setExpectedKind(PathChooser::File); - d->serverStartScriptPathChooser->setPromptDialogTitle(tr("Select Server Start Script")); - d->serverStartScriptPathChooser->setToolTip(tr( - "This option can be used to point to a script that will be used " - "to start a debug server. If the field is empty, " - "default methods to set up debug servers will be used.")); - d->serverStartScriptLabel = new QLabel(tr("&Server start script:"), this); - d->serverStartScriptLabel->setBuddy(d->serverStartScriptPathChooser); - d->serverStartScriptLabel->setToolTip(d->serverStartScriptPathChooser->toolTip()); - d->sysRootPathChooser = new PathChooser(this); d->sysRootPathChooser->setExpectedKind(PathChooser::Directory); d->sysRootPathChooser->setHistoryCompleter("Debugger.SysRoot.History"); @@ -328,7 +311,6 @@ StartApplicationDialog::StartApplicationDialog(QWidget *parent) formLayout->addRow(tr("Run in &terminal:"), d->runInTerminalCheckBox); formLayout->addRow(tr("Break at \"&main\":"), d->breakAtMainCheckBox); formLayout->addRow(tr("Use target extended-remote to connect:"), d->useTargetExtendedRemoteCheckBox); - formLayout->addRow(d->serverStartScriptLabel, d->serverStartScriptPathChooser); formLayout->addRow(d->sysRootLabel, d->sysRootPathChooser); formLayout->addRow(d->serverInitCommandsLabel, d->serverInitCommandsTextEdit); formLayout->addRow(d->serverResetCommandsLabel, d->serverResetCommandsTextEdit); @@ -418,8 +400,6 @@ void StartApplicationDialog::run(bool attachRemote) dialog.setHistory(history); dialog.setParameters(history.back()); if (!attachRemote) { - dialog.d->serverStartScriptPathChooser->setVisible(false); - dialog.d->serverStartScriptLabel->setVisible(false); dialog.d->serverInitCommandsTextEdit->setVisible(false); dialog.d->serverInitCommandsLabel->setVisible(false); dialog.d->serverResetCommandsTextEdit->setVisible(false); @@ -465,7 +445,6 @@ void StartApplicationDialog::run(bool attachRemote) debugger->setBreakOnMain(newParameters.breakAtMain); debugger->setDebugInfoLocation(newParameters.debugInfoLocation); debugger->setInferior(inferior); - debugger->setServerStartScript(newParameters.serverStartScript); // Note: This requires inferior. debugger->setCommandsAfterConnect(newParameters.serverInitCommands); debugger->setCommandsForReset(newParameters.serverResetCommands); debugger->setUseTerminal(newParameters.runInTerminal); @@ -505,7 +484,6 @@ StartApplicationParameters StartApplicationDialog::parameters() const result.serverPort = d->serverPortSpinBox->value(); result.serverAddress = d->channelOverrideEdit->text(); result.runnable.executable = d->localExecutablePathChooser->filePath(); - result.serverStartScript = d->serverStartScriptPathChooser->filePath(); result.sysRoot = d->sysRootPathChooser->filePath(); result.serverInitCommands = d->serverInitCommandsTextEdit->toPlainText(); result.serverResetCommands = d->serverResetCommandsTextEdit->toPlainText(); @@ -525,7 +503,6 @@ void StartApplicationDialog::setParameters(const StartApplicationParameters &p) d->serverPortSpinBox->setValue(p.serverPort); d->channelOverrideEdit->setText(p.serverAddress); d->localExecutablePathChooser->setFilePath(p.runnable.executable); - d->serverStartScriptPathChooser->setFilePath(p.serverStartScript); d->sysRootPathChooser->setFilePath(p.sysRoot); d->serverInitCommandsTextEdit->setPlainText(p.serverInitCommands); d->serverResetCommandsTextEdit->setPlainText(p.serverResetCommands); diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp index 837c71f9062..e3fcefe3bf7 100644 --- a/src/plugins/debugger/debuggerruncontrol.cpp +++ b/src/plugins/debugger/debuggerruncontrol.cpp @@ -95,98 +95,6 @@ DebuggerEngine *createQmlEngine(); DebuggerEngine *createLldbEngine(); DebuggerEngine *createUvscEngine(); -class LocalProcessRunner : public RunWorker -{ - Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::LocalProcessRunner) - -public: - LocalProcessRunner(DebuggerRunTool *runTool, const CommandLine &command) - : RunWorker(runTool->runControl()), m_runTool(runTool), m_command(command) - { - connect(&m_proc, &QtcProcess::errorOccurred, - this, &LocalProcessRunner::handleError); - connect(&m_proc, &QtcProcess::readyReadStandardOutput, - this, &LocalProcessRunner::handleStandardOutput); - connect(&m_proc, &QtcProcess::readyReadStandardError, - this, &LocalProcessRunner::handleStandardError); - connect(&m_proc, &QtcProcess::finished, - this, &LocalProcessRunner::handleFinished); - } - - void start() override - { - m_proc.setCommand(m_command); - m_proc.start(); - } - - void stop() override - { - m_proc.terminate(); - } - - void handleStandardOutput() - { - const QByteArray ba = m_proc.readAllStandardOutput(); - const QString msg = QString::fromLocal8Bit(ba, ba.length()); - m_runTool->appendMessage(msg, StdOutFormat); - } - - void handleStandardError() - { - const QByteArray ba = m_proc.readAllStandardError(); - const QString msg = QString::fromLocal8Bit(ba, ba.length()); - m_runTool->appendMessage(msg, StdErrFormat); - } - - void handleFinished() - { - if (m_proc.result() == QtcProcess::FinishedWithSuccess) { - // all good. - reportDone(); - } else { - reportFailure(tr("Upload failed: %1").arg(m_proc.errorString())); - } - } - - void handleError(QProcess::ProcessError error) - { - QString msg; - switch (error) { - case QProcess::FailedToStart: - msg = tr("The upload process failed to start. Shell missing?"); - break; - case QProcess::Crashed: - msg = tr("The upload process crashed some time after starting " - "successfully."); - break; - case QProcess::Timedout: - msg = tr("The last waitFor...() function timed out. " - "The state of QProcess is unchanged, and you can try calling " - "waitFor...() again."); - break; - case QProcess::WriteError: - msg = tr("An error occurred when attempting to write " - "to the upload process. For example, the process may not be running, " - "or it may have closed its input channel."); - break; - case QProcess::ReadError: - msg = tr("An error occurred when attempting to read from " - "the upload process. For example, the process may not be running."); - break; - default: - msg = tr("An unknown error in the upload process occurred. " - "This is the default return value of error()."); - } - - m_runTool->showMessage(msg, StatusBar); - Core::AsynchronousMessageBox::critical(tr("Error"), msg); - } - - QPointer m_runTool; - CommandLine m_command; - Utils::QtcProcess m_proc; -}; - class CoreUnpacker final : public RunWorker { public: @@ -421,16 +329,6 @@ void DebuggerRunTool::setCommandsForReset(const QString &commands) m_runParameters.commandsForReset = commands; } -void DebuggerRunTool::setServerStartScript(const FilePath &serverStartScript) -{ - if (!serverStartScript.isEmpty()) { - // Provide script information about the environment - const CommandLine serverStarter(serverStartScript, - {m_runParameters.inferior.executable.toString(), m_runParameters.remoteChannel}); - addStartDependency(new LocalProcessRunner(this, serverStarter)); - } -} - void DebuggerRunTool::setDebugInfoLocation(const QString &debugInfoLocation) { m_runParameters.debugInfoLocation = debugInfoLocation;