//
///////////////////////////////////////////////////////////////////////
-StartRemoteDialog::StartRemoteDialog(QWidget *parent)
+StartRemoteDialog::StartRemoteDialog(QWidget *parent, bool enableStartScript)
: QDialog(parent),
m_ui(new Ui::StartRemoteDialog)
{
m_ui->sysrootPathChooser->setPromptDialogTitle(tr("Select Sysroot"));
m_ui->overrideStartScriptPathChooser->setExpectedKind(PathChooser::File);
m_ui->overrideStartScriptPathChooser->setPromptDialogTitle(tr("Select GDB Start Script"));
- m_ui->serverStartScript->setExpectedKind(PathChooser::File);
- m_ui->serverStartScript->setPromptDialogTitle(tr("Select Server Start Script"));
+ m_ui->serverStartScriptPathChooser->setExpectedKind(PathChooser::File);
+ m_ui->serverStartScriptPathChooser->setPromptDialogTitle(tr("Select Server Start Script"));
+ m_ui->serverStartScriptPathChooser->setVisible(enableStartScript);
+ m_ui->serverStartScriptLabel->setVisible(enableStartScript);
+ m_ui->useServerStartScriptCheckBox->setVisible(enableStartScript);
+ m_ui->useServerStartScriptLabel->setVisible(enableStartScript);
connect(m_ui->useServerStartScriptCheckBox, SIGNAL(toggled(bool)),
- this, SLOT(updateState()));
-
- connect(m_ui->buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
- connect(m_ui->buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+ SLOT(updateState()));
+ connect(m_ui->buttonBox, SIGNAL(accepted()), SLOT(accept()));
+ connect(m_ui->buttonBox, SIGNAL(rejected()), SLOT(reject()));
updateState();
}
void StartRemoteDialog::setServerStartScript(const QString &scriptName)
{
- m_ui->serverStartScript->setPath(scriptName);
+ m_ui->serverStartScriptPathChooser->setPath(scriptName);
}
QString StartRemoteDialog::serverStartScript() const
{
- return m_ui->serverStartScript->path();
+ return m_ui->serverStartScriptPathChooser->path();
}
void StartRemoteDialog::setUseServerStartScript(bool on)
{
bool enabled = m_ui->useServerStartScriptCheckBox->isChecked();
m_ui->serverStartScriptLabel->setEnabled(enabled);
- m_ui->serverStartScript->setEnabled(enabled);
+ m_ui->serverStartScriptPathChooser->setEnabled(enabled);
}
///////////////////////////////////////////////////////////////////////
void startExternalApplication();
void startRemoteCdbSession();
void startRemoteApplication();
+ bool queryRemoteParameters(DebuggerStartParameters &sp, bool useScript);
+ void attachRemoteApplication();
void attachToQmlPort();
void startRemoteEngine();
void attachExternalApplication();
QAction *m_startExternalAction;
QAction *m_startRemoteAction;
QAction *m_attachToQmlPortAction;
+ QAction *m_attachRemoteAction;
QAction *m_startRemoteCdbAction;
QAction *m_startRemoteLldbAction;
QAction *m_attachExternalAction;
m_startAction = 0;
m_startExternalAction = 0;
m_startRemoteAction = 0;
+ m_attachRemoteAction = 0;
m_attachToQmlPortAction = 0;
m_startRemoteCdbAction = 0;
m_startRemoteLldbAction = 0;
m_attachExternalAction->setVisible(debuggerIsCPP);
m_attachCoreAction->setVisible(debuggerIsCPP);
m_startRemoteAction->setVisible(debuggerIsCPP);
+ m_attachRemoteAction->setVisible(debuggerIsCPP);
m_detachAction->setVisible(debuggerIsCPP);
m_attachToQmlPortAction->setVisible(m_mainWindow->activeDebugLanguages() & QmlLanguage);
}
startDebugger(rc);
}
-void DebuggerPluginPrivate::startRemoteApplication()
+bool DebuggerPluginPrivate::queryRemoteParameters(DebuggerStartParameters &sp, bool useScript)
{
- DebuggerStartParameters sp;
- StartRemoteDialog dlg(mainWindow());
+ StartRemoteDialog dlg(mainWindow(), useScript);
QStringList arches;
arches.append(_("i386:x86-64:intel"));
arches.append(_("i386"));
configValue(_("LastUseServerStartScript")).toBool());
dlg.setSysroot(configValue(_("LastSysroot")).toString());
if (dlg.exec() != QDialog::Accepted)
- return;
+ return false;
setConfigValue(_("LastRemoteChannel"), dlg.remoteChannel());
setConfigValue(_("LastLocalExecutable"), dlg.localExecutable());
setConfigValue(_("LastDebugger"), dlg.debugger());
sp.useServerStartScript = dlg.useServerStartScript();
sp.serverStartScript = dlg.serverStartScript();
sp.sysroot = dlg.sysroot();
+ return true;
+}
+
+void DebuggerPluginPrivate::startRemoteApplication()
+{
+ DebuggerStartParameters sp;
+ if (queryRemoteParameters(sp, true))
+ if (RunControl *rc = createDebugger(sp))
+ startDebugger(rc);
+}
+
+void DebuggerPluginPrivate::attachRemoteApplication()
+{
+ DebuggerStartParameters sp;
+ if (!queryRemoteParameters(sp, false))
+ return;
+ sp.useServerStartScript = false;
+ sp.serverStartScript.clear();
if (RunControl *rc = createDebugger(sp))
startDebugger(rc);
}
m_attachToQmlPortAction->setEnabled(true);
m_attachCoreAction->setEnabled(true);
m_startRemoteAction->setEnabled(true);
+ m_attachRemoteAction->setEnabled(true);
m_detachAction->setEnabled(false);
m_watchAction1->setEnabled(true);
m_attachExternalAction->setEnabled(true);
m_attachCoreAction->setEnabled(true);
m_startRemoteAction->setEnabled(true);
+ m_attachRemoteAction->setEnabled(true);
const bool isCore = engine->startParameters().startMode == AttachCore;
const bool stopped = state == InferiorStopOk;
connect(act, SIGNAL(triggered()), SLOT(attachCore()));
act = m_startRemoteAction = new QAction(this);
- act->setText(tr("Start and Attach to Remote Application..."));
+ act->setText(tr("Start and Debug Remote Application..."));
connect(act, SIGNAL(triggered()), SLOT(startRemoteApplication()));
+ act = m_attachRemoteAction = new QAction(this);
+ act->setText(tr("Attach to Remote Debug Server..."));
+ connect(act, SIGNAL(triggered()), SLOT(attachRemoteApplication()));
+
act = m_attachToQmlPortAction = new QAction(this);
act->setText(tr("Attach to QML Port..."));
connect(act, SIGNAL(triggered()), SLOT(attachToQmlPort()));
mstart->addAction(cmd, CC::G_DEFAULT_ONE);
cmd = am->registerAction(m_startRemoteAction,
+ "Debugger.StartRemote", globalcontext);
+ cmd->setAttribute(Command::CA_Hide);
+ mstart->addAction(cmd, CC::G_DEFAULT_ONE);
+
+ cmd = am->registerAction(m_attachRemoteAction,
"Debugger.AttachRemote", globalcontext);
cmd->setAttribute(Command::CA_Hide);
mstart->addAction(cmd, CC::G_DEFAULT_ONE);