diff --git a/src/plugins/debugger/debuggerdialogs.cpp b/src/plugins/debugger/debuggerdialogs.cpp index b1babc5ab25bb817a90344e5751ab6b24f43fb46..e13502c351f2aa7c089300780a6b2ee861b6bb9a 100644 --- a/src/plugins/debugger/debuggerdialogs.cpp +++ b/src/plugins/debugger/debuggerdialogs.cpp @@ -665,6 +665,8 @@ StartRemoteDialog::StartRemoteDialog(QWidget *parent, bool enableStartScript) m_ui->buttonBox->button(QDialogButtonBox::Ok)->setDefault(true); m_ui->debuggerPathChooser->setExpectedKind(PathChooser::File); m_ui->debuggerPathChooser->setPromptDialogTitle(tr("Select Debugger")); + m_ui->debuginfoPathChooser->setExpectedKind(PathChooser::File); + m_ui->debuginfoPathChooser->setPromptDialogTitle(tr("Select Location of Debugging Information")); m_ui->executablePathChooser->setExpectedKind(PathChooser::File); m_ui->executablePathChooser->setPromptDialogTitle(tr("Select Executable")); m_ui->sysrootPathChooser->setPromptDialogTitle(tr("Select Sysroot")); @@ -720,6 +722,16 @@ QString StartRemoteDialog::debugger() const return m_ui->debuggerPathChooser->path(); } +void StartRemoteDialog::setDebugInfoLocation(const QString &location) +{ + m_ui->debuginfoPathChooser->setPath(location); +} + +QString StartRemoteDialog::debugInfoLocation() const +{ + return m_ui->debuginfoPathChooser->path(); +} + void StartRemoteDialog::setRemoteArchitectures(const QStringList &list) { m_ui->architectureComboBox->clear(); diff --git a/src/plugins/debugger/debuggerdialogs.h b/src/plugins/debugger/debuggerdialogs.h index 8dd98ec60fee19431ea5ea69e5f82d9f967f2a53..1f1bf735a282a4a6d1e0a9dbd64caf5d41903d4b 100644 --- a/src/plugins/debugger/debuggerdialogs.h +++ b/src/plugins/debugger/debuggerdialogs.h @@ -210,6 +210,9 @@ public: QString debugger() const; void setDebugger(const QString &debugger); + void setDebugInfoLocation(const QString &location); + QString debugInfoLocation() const; + private slots: void updateState(); diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 2c06727dd9d46d2b84f514154bc5acc469784670..6d27e1f03e1902d6de93b8f0facfb1ab48d6a335 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -1585,6 +1585,7 @@ bool DebuggerPluginPrivate::queryRemoteParameters(DebuggerStartParameters &sp, b dlg.setUseServerStartScript( configValue(_("LastUseServerStartScript")).toBool()); dlg.setSysroot(configValue(_("LastSysroot")).toString()); + dlg.setDebugInfoLocation(configValue(_("LastDebugInfoLocation")).toString()); if (dlg.exec() != QDialog::Accepted) return false; setConfigValue(_("LastRemoteChannel"), dlg.remoteChannel()); @@ -1596,6 +1597,7 @@ bool DebuggerPluginPrivate::queryRemoteParameters(DebuggerStartParameters &sp, b setConfigValue(_("LastServerStartScript"), dlg.serverStartScript()); setConfigValue(_("LastUseServerStartScript"), dlg.useServerStartScript()); setConfigValue(_("LastSysroot"), dlg.sysroot()); + setConfigValue(_("LastDebugInfoLocation"), dlg.debugInfoLocation()); sp.remoteChannel = dlg.remoteChannel(); sp.remoteArchitecture = dlg.remoteArchitecture(); sp.gnuTarget = dlg.gnuTarget(); @@ -1609,6 +1611,9 @@ bool DebuggerPluginPrivate::queryRemoteParameters(DebuggerStartParameters &sp, b sp.useServerStartScript = dlg.useServerStartScript(); sp.serverStartScript = dlg.serverStartScript(); sp.sysroot = dlg.sysroot(); + sp.debugInfoLocation = dlg.debugInfoLocation(); + if (sp.debugInfoLocation.isEmpty()) + sp.debugInfoLocation = sp.sysroot + "/usr/lib/debug"; return true; } diff --git a/src/plugins/debugger/debuggerstartparameters.h b/src/plugins/debugger/debuggerstartparameters.h index 2ee3f76757fd5ee27f45115d20bddb8a6da8e2a3..79d7485e3b04cf9e3c074b3968102b125154e6cf 100644 --- a/src/plugins/debugger/debuggerstartparameters.h +++ b/src/plugins/debugger/debuggerstartparameters.h @@ -108,6 +108,7 @@ public: bool useServerStartScript; QString serverStartScript; QString sysroot; + QString debugInfoLocation; QByteArray remoteDumperLib; QByteArray remoteSourcesDir; QString remoteMountPoint; diff --git a/src/plugins/debugger/gdb/remotegdbserveradapter.cpp b/src/plugins/debugger/gdb/remotegdbserveradapter.cpp index 525aec35018b037ffaf38c5ada9b1b6c66bfb7eb..b1cf4d01cf1602b08ab4660cb2ed647358dee0c6 100644 --- a/src/plugins/debugger/gdb/remotegdbserveradapter.cpp +++ b/src/plugins/debugger/gdb/remotegdbserveradapter.cpp @@ -161,18 +161,19 @@ void RemoteGdbServerAdapter::uploadProcFinished() void RemoteGdbServerAdapter::setupInferior() { QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state()); + const DebuggerStartParameters &sp = startParameters(); QString fileName; - if (!startParameters().executable.isEmpty()) { - QFileInfo fi(startParameters().executable); + if (!sp.executable.isEmpty()) { + QFileInfo fi(sp.executable); fileName = fi.absoluteFilePath(); } - 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; + const QByteArray sysroot = sp.sysroot.toLocal8Bit(); + const QByteArray debugInfoLocation = sp.debugInfoLocation.toLocal8Bit(); + const QByteArray remoteArch = sp.remoteArchitecture.toLatin1(); + const QByteArray gnuTarget = sp.gnuTarget.toLatin1(); + const QByteArray solibPath = QFileInfo(sp.dumperLibrary).path().toLocal8Bit(); + const QString args = sp.processArgs; if (!remoteArch.isEmpty()) m_engine->postCommand("set architecture " + remoteArch); @@ -180,6 +181,8 @@ void RemoteGdbServerAdapter::setupInferior() m_engine->postCommand("set gnutarget " + gnuTarget); if (!sysroot.isEmpty()) m_engine->postCommand("set sysroot " + sysroot); + if (!sysroot.isEmpty()) + m_engine->postCommand("set debug-file-directory " + debugInfoLocation); if (!solibPath.isEmpty()) m_engine->postCommand("set solib-search-path " + solibPath); if (!args.isEmpty()) diff --git a/src/plugins/debugger/startremotedialog.ui b/src/plugins/debugger/startremotedialog.ui index e74cbaf7429f3d4c4ac52f93358332605c274efa..1dabe7c23de2d67a8ad8c54b2729fa2fb2b8ede5 100644 --- a/src/plugins/debugger/startremotedialog.ui +++ b/src/plugins/debugger/startremotedialog.ui @@ -107,6 +107,19 @@ <widget class="Utils::PathChooser" name="sysrootPathChooser"/> </item> <item row="6" column="0"> + <widget class="QLabel" name="debuginfoLabel"> + <property name="text"> + <string>Location of debugging information:</string> + </property> + <property name="buddy"> + <cstring>debuginfoPathChooser</cstring> + </property> + </widget> + </item> + <item row="6" column="1"> + <widget class="Utils::PathChooser" name="debuginfoPathChooser"/> + </item> + <item row="7" column="0"> <widget class="QLabel" name="overrideStartScriptLabel"> <property name="text"> <string>Override host GDB s&tart script:</string> @@ -116,10 +129,10 @@ </property> </widget> </item> - <item row="6" column="1"> + <item row="7" column="1"> <widget class="Utils::PathChooser" name="overrideStartScriptPathChooser"/> </item> - <item row="7" column="0"> + <item row="8" column="0"> <widget class="QLabel" name="useServerStartScriptLabel"> <property name="text"> <string>&Use server start script:</string> @@ -129,10 +142,10 @@ </property> </widget> </item> - <item row="7" column="1"> + <item row="8" column="1"> <widget class="QCheckBox" name="useServerStartScriptCheckBox"/> </item> - <item row="8" column="0"> + <item row="9" column="0"> <widget class="QLabel" name="serverStartScriptLabel"> <property name="text"> <string>&Server start script:</string> @@ -142,7 +155,7 @@ </property> </widget> </item> - <item row="8" column="1"> + <item row="9" column="1"> <widget class="Utils::PathChooser" name="serverStartScriptPathChooser"/> </item> </layout>