diff --git a/src/plugins/debugger/gdb/startgdbserverdialog.cpp b/src/plugins/debugger/gdb/startgdbserverdialog.cpp index ce04b6fbeeb..dc6f4fe2d66 100644 --- a/src/plugins/debugger/gdb/startgdbserverdialog.cpp +++ b/src/plugins/debugger/gdb/startgdbserverdialog.cpp @@ -122,7 +122,10 @@ void GdbServerStarter::portListReady() connect(&d->runner, SIGNAL(readyReadStandardError()), SLOT(handleProcessErrorOutput())); connect(&d->runner, SIGNAL(processClosed(int)), SLOT(handleProcessClosed(int))); - QByteArray cmd = "gdbserver --attach :" + QByteArray gdbServerPath = d->device->debugServerPath().toUtf8(); + if (gdbServerPath.isEmpty()) + gdbServerPath = "gdbserver"; + QByteArray cmd = gdbServerPath + " --attach :" + QByteArray::number(port) + ' ' + QByteArray::number(d->process.pid); logMessage(tr("Running command: %1").arg(QString::fromLatin1(cmd))); d->runner.run(cmd, d->device->sshParameters()); diff --git a/src/plugins/projectexplorer/devicesupport/idevice.cpp b/src/plugins/projectexplorer/devicesupport/idevice.cpp index f39615def88..d4ebaf979d9 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.cpp +++ b/src/plugins/projectexplorer/devicesupport/idevice.cpp @@ -162,6 +162,8 @@ const char KeyFileKey[] = "KeyFile"; const char PasswordKey[] = "Password"; const char TimeoutKey[] = "Timeout"; +const char DebugServerKey[] = "DebugServerKey"; + typedef QSsh::SshConnectionParameters::AuthenticationType AuthType; const AuthType DefaultAuthType = QSsh::SshConnectionParameters::AuthenticationTypePublicKey; const IDevice::MachineType DefaultMachineType = IDevice::Hardware; @@ -189,6 +191,7 @@ public: QSsh::SshConnectionParameters sshParameters; Utils::PortList freePorts; + QString debugServerPath; }; } // namespace Internal @@ -325,6 +328,8 @@ void IDevice::fromMap(const QVariantMap &map) QLatin1String("10000-10100")).toString()); d->machineType = static_cast(map.value(QLatin1String(MachineTypeKey), DefaultMachineType).toInt()); d->version = map.value(QLatin1String(VersionKey), 0).toInt(); + + d->debugServerPath = map.value(QLatin1String(DebugServerKey)).toString(); } QVariantMap IDevice::toMap() const @@ -347,6 +352,8 @@ QVariantMap IDevice::toMap() const map.insert(QLatin1String(PortsSpecKey), d->freePorts.toString()); map.insert(QLatin1String(VersionKey), d->version); + map.insert(QLatin1String(DebugServerKey), d->debugServerPath); + return map; } @@ -397,6 +404,16 @@ IDevice::MachineType IDevice::machineType() const return d->machineType; } +QString IDevice::debugServerPath() const +{ + return d->debugServerPath; +} + +void IDevice::setDebugServerPath(const QString &path) +{ + d->debugServerPath = path; +} + int IDevice::version() const { return d->version; diff --git a/src/plugins/projectexplorer/devicesupport/idevice.h b/src/plugins/projectexplorer/devicesupport/idevice.h index 8b416c04099..b8e928f6945 100644 --- a/src/plugins/projectexplorer/devicesupport/idevice.h +++ b/src/plugins/projectexplorer/devicesupport/idevice.h @@ -149,6 +149,9 @@ public: MachineType machineType() const; + QString debugServerPath() const; + void setDebugServerPath(const QString &path); + protected: IDevice(); IDevice(Core::Id type, Origin origin, MachineType machineType, Core::Id id = Core::Id()); diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp index ee93658fc3f..34959f4a1c9 100644 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp +++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp @@ -60,6 +60,7 @@ GenericLinuxDeviceConfigurationWidget::GenericLinuxDeviceConfigurationWidget( connect(m_ui->showPasswordCheckBox, SIGNAL(toggled(bool)), this, SLOT(showPassword(bool))); connect(m_ui->portsLineEdit, SIGNAL(editingFinished()), this, SLOT(handleFreePortsChanged())); connect(m_ui->createKeyButton, SIGNAL(clicked()), SLOT(createNewKey())); + connect(m_ui->gdbServerLineEdit, SIGNAL(editingFinished()), SLOT(gdbServerEditingFinished())); initGui(); } @@ -125,6 +126,11 @@ void GenericLinuxDeviceConfigurationWidget::keyFileEditingFinished() device()->setSshParameters(sshParams); } +void GenericLinuxDeviceConfigurationWidget::gdbServerEditingFinished() +{ + device()->setDebugServerPath(m_ui->gdbServerLineEdit->text()); +} + void GenericLinuxDeviceConfigurationWidget::handleFreePortsChanged() { device()->setFreePorts(PortList::fromString(m_ui->portsLineEdit->text())); @@ -159,6 +165,7 @@ void GenericLinuxDeviceConfigurationWidget::updateDeviceFromUi() passwordEditingFinished(); keyFileEditingFinished(); handleFreePortsChanged(); + gdbServerEditingFinished(); } void GenericLinuxDeviceConfigurationWidget::updatePortsWarningLabel() @@ -199,5 +206,6 @@ void GenericLinuxDeviceConfigurationWidget::initGui() m_ui->pwdLineEdit->setText(sshParams.password); m_ui->keyFileLineEdit->setPath(sshParams.privateKeyFile); m_ui->showPasswordCheckBox->setChecked(false); + m_ui->gdbServerLineEdit->setText(device()->debugServerPath()); updatePortsWarningLabel(); } diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.h b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.h index 420f4a761db..db0a6777d27 100644 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.h +++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.h @@ -58,6 +58,7 @@ private slots: void userNameEditingFinished(); void passwordEditingFinished(); void keyFileEditingFinished(); + void gdbServerEditingFinished(); void showPassword(bool showClearText); void handleFreePortsChanged(); void setPrivateKey(const QString &path); diff --git a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.ui b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.ui index a1b2dbea5cd..1d935a9c2cf 100644 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.ui +++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.ui @@ -7,7 +7,7 @@ 0 0 393 - 206 + 321 @@ -17,7 +17,16 @@ QFormLayout::FieldsStayAtSizeHint - + + 0 + + + 0 + + + 0 + + 0 @@ -30,7 +39,16 @@ - + + 0 + + + 0 + + + 0 + + 0 @@ -233,6 +251,20 @@ + + + + GDB server executable: + + + + + + + Leave empty to look up executable in $PATH + + + passwordLabel authTypeButtonsWidget @@ -244,6 +276,8 @@ keyLabel machineTypeLabel machineTypeValueLabel + gdbServerLabel + gdbServerLineEdit diff --git a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp index 9e53238bd32..030df3661ef 100644 --- a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp +++ b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp @@ -162,17 +162,19 @@ void LinuxDeviceDebugSupport::startExecution() connect(runner, SIGNAL(remoteStdout(QByteArray)), SLOT(handleRemoteOutput(QByteArray))); if (d->qmlDebugging && !d->cppDebugging) connect(runner, SIGNAL(remoteProcessStarted()), SLOT(handleRemoteProcessStarted())); - QString command; + QStringList args = arguments(); - if (d->qmlDebugging) - args += QString::fromLocal8Bit("-qmljsdebugger=port:%1,block").arg(d->qmlPort); + QString command; if (d->qmlDebugging && !d->cppDebugging) { command = remoteFilePath(); } else { - command = QLatin1String("gdbserver"); + command = device()->debugServerPath(); + if (command.isEmpty()) + command = QLatin1String("gdbserver"); args.prepend(remoteFilePath()); args.prepend(QString::fromLatin1(":%1").arg(d->gdbServerPort)); } + connect(runner, SIGNAL(finished(bool)), SLOT(handleAppRunnerFinished(bool))); connect(runner, SIGNAL(reportProgress(QString)), SLOT(handleProgressReport(QString))); connect(runner, SIGNAL(reportError(QString)), SLOT(handleAppRunnerError(QString)));