Commit 0bea2457 authored by Christian Kandeler's avatar Christian Kandeler
Browse files

Debugger/Remote Debugging: Add "GNU target" start parameter.

This is needed for multi-architecture gdb.

Reviewed-by: hjk
parent f900b90c
......@@ -686,6 +686,27 @@ QString StartRemoteDialog::remoteArchitecture() const
return m_ui->architectureComboBox->currentText();
}
QString StartRemoteDialog::gnuTarget() const
{
return m_ui->gnuTargetComboBox->currentText();
}
void StartRemoteDialog::setGnuTargets(const QStringList &gnuTargets)
{
m_ui->gnuTargetComboBox->clear();
if (!gnuTargets.isEmpty()) {
m_ui->gnuTargetComboBox->insertItems(0, gnuTargets);
m_ui->gnuTargetComboBox->setCurrentIndex(0);
}
}
void StartRemoteDialog::setGnuTarget(const QString &gnuTarget)
{
const int index = m_ui->gnuTargetComboBox->findText(gnuTarget);
if (index != -1)
m_ui->gnuTargetComboBox->setCurrentIndex(index);
}
void StartRemoteDialog::setServerStartScript(const QString &scriptName)
{
m_ui->serverStartScript->setPath(scriptName);
......
......@@ -178,6 +178,10 @@ public:
void setRemoteArchitecture(const QString &arch);
void setRemoteArchitectures(const QStringList &arches);
QString gnuTarget() const;
void setGnuTarget(const QString &gnuTarget);
void setGnuTargets(const QStringList &gnuTargets);
bool useServerStartScript() const;
void setUseServerStartScript(bool on);
QString serverStartScript() const;
......
......@@ -90,6 +90,7 @@ public:
// for remote debugging
QString remoteChannel;
QString remoteArchitecture;
QString gnuTarget;
QString symbolFileName;
bool useServerStartScript;
QString serverStartScript;
......
......@@ -1877,16 +1877,28 @@ void DebuggerPluginPrivate::startRemoteApplication()
QStringList arches;
arches.append(_("i386:x86-64:intel"));
arches.append(_("i386"));
arches.append(_("arm"));
QString lastUsed = configValue(_("LastRemoteArchitecture")).toString();
if (!arches.contains(lastUsed))
arches.prepend(lastUsed);
dlg.setRemoteArchitectures(arches);
QStringList gnuTargets;
gnuTargets.append(_("auto"));
gnuTargets.append(_("i686-linux-gnu"));
gnuTargets.append(_("x86_64-linux-gnu"));
gnuTargets.append(_("arm-none-linux-gnueabi"));
const QString lastUsedGnuTarget
= configValue(_("LastGnuTarget")).toString();
if (!gnuTargets.contains(lastUsedGnuTarget))
gnuTargets.prepend(lastUsedGnuTarget);
dlg.setGnuTargets(gnuTargets);
dlg.setRemoteChannel(
configValue(_("LastRemoteChannel")).toString());
dlg.setLocalExecutable(
configValue(_("LastLocalExecutable")).toString());
dlg.setDebugger(configValue(_("LastDebugger")).toString());
dlg.setRemoteArchitecture(lastUsed);
dlg.setGnuTarget(lastUsedGnuTarget);
dlg.setServerStartScript(
configValue(_("LastServerStartScript")).toString());
dlg.setUseServerStartScript(
......@@ -1898,11 +1910,13 @@ void DebuggerPluginPrivate::startRemoteApplication()
setConfigValue(_("LastLocalExecutable"), dlg.localExecutable());
setConfigValue(_("LastDebugger"), dlg.debugger());
setConfigValue(_("LastRemoteArchitecture"), dlg.remoteArchitecture());
setConfigValue(_("LastGnuTarget"), dlg.gnuTarget());
setConfigValue(_("LastServerStartScript"), dlg.serverStartScript());
setConfigValue(_("LastUseServerStartScript"), dlg.useServerStartScript());
setConfigValue(_("LastSysroot"), dlg.sysRoot());
sp.remoteChannel = dlg.remoteChannel();
sp.remoteArchitecture = dlg.remoteArchitecture();
sp.gnuTarget = dlg.gnuTarget();
sp.executable = dlg.localExecutable();
sp.displayName = dlg.localExecutable();
sp.debuggerCommand = dlg.debugger(); // Override toolchain-detection.
......
......@@ -171,12 +171,15 @@ void RemoteGdbServerAdapter::setupInferior()
}
const QByteArray sysRoot = startParameters().sysRoot.toLocal8Bit();
const QByteArray remoteArch = startParameters().remoteArchitecture.toLatin1();
const QByteArray gnuTarget = startParameters().gnuTarget.toLatin1();
const QByteArray solibPath =
QFileInfo(startParameters().dumperLibrary).path().toLocal8Bit();
const QString args = startParameters().processArgs.join(_(" "));
if (!remoteArch.isEmpty())
m_engine->postCommand("set architecture " + remoteArch);
if (!gnuTarget.isEmpty())
m_engine->postCommand("set gnutarget " + gnuTarget);
if (!sysRoot.isEmpty())
m_engine->postCommand("set sysroot " + sysRoot);
if (!solibPath.isEmpty())
......
......@@ -6,25 +6,16 @@
<rect>
<x>0</x>
<y>0</y>
<width>439</width>
<height>224</height>
<width>446</width>
<height>269</height>
</rect>
</property>
<property name="windowTitle">
<string>Start Debugger</string>
</property>
<layout class="QVBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<number>9</number>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="debuggerLabel">
<property name="text">
......@@ -74,33 +65,47 @@
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="gnuTargetLabel">
<property name="text">
<string>GNU target</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="gnuTargetComboBox">
<property name="editable">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="sysrootLabel">
<property name="text">
<string>Sysroot:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<item row="5" column="1">
<widget class="Utils::PathChooser" name="sysrootPathChooser" native="true"/>
</item>
<item row="5" column="0">
<item row="6" column="0">
<widget class="QLabel" name="useServerStartScriptLabel">
<property name="text">
<string>Use server start script:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<item row="6" column="1">
<widget class="QCheckBox" name="useServerStartScriptCheckBox"/>
</item>
<item row="6" column="0">
<item row="7" column="0">
<widget class="QLabel" name="serverStartScriptLabel">
<property name="text">
<string>Server start script:</string>
</property>
</widget>
</item>
<item row="6" column="1">
<item row="7" column="1">
<widget class="Utils::PathChooser" name="serverStartScript" native="true"/>
</item>
</layout>
......
......@@ -99,6 +99,7 @@ RunControl *MaemoDebugSupport::createDebugRunControl(MaemoRunConfiguration *runC
+ QString::number(gdbServerPort(runConfig));
params.useServerStartScript = true;
params.remoteArchitecture = QLatin1String("arm");
params.gnuTarget = QLatin1String("arm-none-linux-gnueabi");
}
} else {
params.startMode = AttachToRemote;
......
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