Commit 57634ab2 authored by hjk's avatar hjk
Browse files

debugger: add a line edit to specify the local executable for gdb remote

debugging

Long term that would probably better as a run configuration.
parent b3154e1b
......@@ -385,8 +385,10 @@ StartRemoteDialog::StartRemoteDialog(QWidget *parent)
{
m_ui->setupUi(this);
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setDefault(true);
m_ui->executablePathChooser->setExpectedKind(Utils::PathChooser::File);
m_ui->executablePathChooser->setPromptDialogTitle(tr("Select Executable"));
m_ui->serverStartScript->setExpectedKind(Utils::PathChooser::File);
m_ui->serverStartScript->setPromptDialogTitle(tr("Select Executable"));
m_ui->serverStartScript->setPromptDialogTitle(tr("Select Start Script"));
connect(m_ui->useServerStartScriptCheckBox, SIGNAL(toggled(bool)),
this, SLOT(updateState()));
......@@ -412,6 +414,16 @@ QString StartRemoteDialog::remoteChannel() const
return m_ui->channelLineEdit->text();
}
void StartRemoteDialog::setLocalExecutable(const QString &executable)
{
m_ui->executablePathChooser->setPath(executable);
}
QString StartRemoteDialog::localExecutable() const
{
return m_ui->executablePathChooser->path();
}
void StartRemoteDialog::setRemoteArchitectures(const QStringList &list)
{
m_ui->architectureComboBox->clear();
......@@ -453,12 +465,12 @@ bool StartRemoteDialog::useServerStartScript() const
return m_ui->useServerStartScriptCheckBox->isChecked();
}
void StartRemoteDialog::setSysroot(const QString &sysroot)
void StartRemoteDialog::setSysRoot(const QString &sysroot)
{
m_ui->sysrootPathChooser->setPath(sysroot);
}
const QString StartRemoteDialog::sysroot() const
QString StartRemoteDialog::sysRoot() const
{
return m_ui->sysrootPathChooser->path();
}
......
......@@ -134,14 +134,16 @@ public:
void setRemoteChannel(const QString &host);
void setRemoteArchitecture(const QString &arch);
void setRemoteArchitectures(const QStringList &arches);
void setLocalExecutable(const QString &executable);
QString localExecutable() const;
QString remoteChannel() const;
QString remoteArchitecture() const;
void setServerStartScript(const QString &scriptName);
QString serverStartScript() const;
void setUseServerStartScript(bool on);
bool useServerStartScript() const;
void setSysroot(const QString &sysroot);
const QString sysroot() const;
void setSysRoot(const QString &sysRoot);
QString sysRoot() const;
private slots:
void updateState();
......
......@@ -1340,7 +1340,8 @@ void DebuggerPlugin::attachCore(const QString &core, const QString &exe)
sp->coreFile = core;
sp->startMode = AttachCore;
if (RunControl *runControl = m_debuggerRunControlFactory->create(sp))
ProjectExplorerPlugin::instance()->startRunControl(runControl, ProjectExplorer::Constants::DEBUGMODE);
ProjectExplorerPlugin::instance()->
startRunControl(runControl, ProjectExplorer::Constants::DEBUGMODE);
}
void DebuggerPlugin::startRemoteApplication()
......@@ -1356,28 +1357,33 @@ void DebuggerPlugin::startRemoteApplication()
dlg.setRemoteArchitectures(arches);
dlg.setRemoteChannel(
configValue(_("LastRemoteChannel")).toString());
dlg.setLocalExecutable(
configValue(_("LastLocalExecutable")).toString());
dlg.setRemoteArchitecture(lastUsed);
dlg.setServerStartScript(
configValue(_("LastServerStartScript")).toString());
dlg.setUseServerStartScript(
configValue(_("LastUseServerStartScript")).toBool());
dlg.setSysroot(configValue(_("LastSysroot")).toString());
dlg.setSysRoot(configValue(_("LastSysroot")).toString());
if (dlg.exec() != QDialog::Accepted)
return;
setConfigValue(_("LastRemoteChannel"), dlg.remoteChannel());
setConfigValue(_("LastLocalExecutable"), dlg.localExecutable());
setConfigValue(_("LastRemoteArchitecture"), dlg.remoteArchitecture());
setConfigValue(_("LastServerStartScript"), dlg.serverStartScript());
setConfigValue(_("LastUseServerStartScript"), dlg.useServerStartScript());
setConfigValue(_("LastSysroot"), dlg.sysroot());
setConfigValue(_("LastSysroot"), dlg.sysRoot());
sp->remoteChannel = dlg.remoteChannel();
sp->remoteArchitecture = dlg.remoteArchitecture();
sp->executable = dlg.localExecutable();
sp->startMode = StartRemote;
if (dlg.useServerStartScript())
sp->serverStartScript = dlg.serverStartScript();
sp->sysRoot = dlg.sysroot();
sp->sysRoot = dlg.sysRoot();
if (RunControl *runControl = m_debuggerRunControlFactory->create(sp))
ProjectExplorerPlugin::instance()->startRunControl(runControl, ProjectExplorer::Constants::DEBUGMODE);
ProjectExplorerPlugin::instance()
->startRunControl(runControl, ProjectExplorer::Constants::DEBUGMODE);
}
#include "debuggerplugin.moc"
......
......@@ -166,7 +166,7 @@ void RemoteGdbAdapter::startInferior()
+ startParameters().processArgs.join(_(" ")));
m_engine->postCommand(_("set target-async on"), CB(handleSetTargetAsync));
QString x = startParameters().executable;
QFileInfo fi(startParameters().executable);
QString fileName = fi.absoluteFilePath();
m_engine->postCommand(_("-file-exec-and-symbols \"%1\"").arg(fileName),
......
......@@ -25,28 +25,31 @@
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<item row="0" column="0">
<item row="1" column="0">
<widget class="QLabel" name="channelLabel">
<property name="text">
<string>Host and port:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<item row="1" column="1">
<widget class="QLineEdit" name="channelLineEdit">
<property name="text">
<string notr="true">localhost:5115</string>
</property>
</widget>
</item>
<item row="1" column="0">
<item row="0" column="1">
<widget class="Utils::PathChooser" name="executablePathChooser" native="true"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="architectureLabel">
<property name="text">
<string>Architecture:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<item row="2" column="1">
<widget class="QComboBox" name="architectureComboBox">
<property name="editable">
<bool>true</bool>
......@@ -73,16 +76,23 @@
</property>
</widget>
</item>
<item row="2" column="0">
<item row="3" column="0">
<widget class="QLabel" name="sysrootLabel">
<property name="text">
<string>Sysroot:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<item row="3" column="1">
<widget class="Utils::PathChooser" name="sysrootPathChooser" native="true"/>
</item>
<item row="0" column="0">
<widget class="QLabel" name="executableLabel">
<property name="text">
<string>Local executable:</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment