diff --git a/src/plugins/debugger/gdb/startgdbserverdialog.cpp b/src/plugins/debugger/gdb/startgdbserverdialog.cpp index ce04b6fbeeb6dfc15e58fa21aa12c33bd9d15f9d..dc6f4fe2d66e769b084f82cfc12e5273f43918ac 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 f39615def8886199b787da1fcfd4e9c880a3094e..d4ebaf979d99222ff5b5eab847f8ece2135b31dd 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<MachineType>(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 8b416c04099be04667a2787c3fdb9dc975c7fe33..b8e928f694525704b032eb10b41bbba7d2e1639d 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 ee93658fc3f1cf66eedb1529ecb3eb347cd50a9a..34959f4a1c9ae3b7a362407658a150d8a9bbad17 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 420f4a761db24412edff47ea171301e876663b86..db0a6777d27939a7b679f28a38b4fd30e2b79f92 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 a1b2dbea5cde3802473b5ee6300fe0ffef2db25f..1d935a9c2cfa1831149cfd671d8e71934fae1226 100644 --- a/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.ui +++ b/src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.ui @@ -7,7 +7,7 @@ <x>0</x> <y>0</y> <width>393</width> - <height>206</height> + <height>321</height> </rect> </property> <property name="windowTitle"> @@ -17,7 +17,16 @@ <property name="fieldGrowthPolicy"> <enum>QFormLayout::FieldsStayAtSizeHint</enum> </property> - <property name="margin"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> <number>0</number> </property> <item row="1" column="0"> @@ -30,7 +39,16 @@ <item row="1" column="1"> <widget class="QWidget" name="authTypeButtonsWidget" native="true"> <layout class="QHBoxLayout" name="horizontalLayout_3"> - <property name="margin"> + <property name="leftMargin"> + <number>0</number> + </property> + <property name="topMargin"> + <number>0</number> + </property> + <property name="rightMargin"> + <number>0</number> + </property> + <property name="bottomMargin"> <number>0</number> </property> <item> @@ -233,6 +251,20 @@ <item row="0" column="1"> <widget class="QLabel" name="machineTypeValueLabel"/> </item> + <item row="7" column="0"> + <widget class="QLabel" name="gdbServerLabel"> + <property name="text"> + <string>GDB server executable:</string> + </property> + </widget> + </item> + <item row="7" column="1"> + <widget class="QLineEdit" name="gdbServerLineEdit"> + <property name="placeholderText"> + <string>Leave empty to look up executable in $PATH</string> + </property> + </widget> + </item> </layout> <zorder>passwordLabel</zorder> <zorder>authTypeButtonsWidget</zorder> @@ -244,6 +276,8 @@ <zorder>keyLabel</zorder> <zorder>machineTypeLabel</zorder> <zorder>machineTypeValueLabel</zorder> + <zorder>gdbServerLabel</zorder> + <zorder>gdbServerLineEdit</zorder> </widget> <customwidgets> <customwidget> diff --git a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp index 9e53238bd3238ac0fc2ebc16b531097ffff2e9a3..030df3661efadab9dcfe15b75721aef190ebf436 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)));