From 26e7ed14b7cc275c6975d24f3a13e0c81a050f2b Mon Sep 17 00:00:00 2001
From: hjk <qthjk@ovi.com>
Date: Wed, 25 Jul 2012 03:38:19 +0200
Subject: [PATCH] debugger: remove unused code

Change-Id: I105aa0433530abb4e9f53de19c0846281ccda0cf
Reviewed-by: hjk <qthjk@ovi.com>
---
 src/plugins/android/androiddebugsupport.cpp   |  1 -
 src/plugins/debugger/debuggerdialogs.cpp      | 33 +------------------
 src/plugins/debugger/debuggerdialogs.h        |  2 --
 src/plugins/debugger/debuggerengine.cpp       |  1 -
 src/plugins/debugger/debuggerplugin.cpp       | 24 ++------------
 .../debugger/debuggerstartparameters.h        |  1 -
 .../qnx/blackberryruncontrolfactory.cpp       |  4 +--
 src/plugins/qnx/qnxruncontrolfactory.cpp      |  4 +--
 .../remotelinux/remotelinuxdebugsupport.cpp   |  1 -
 9 files changed, 5 insertions(+), 66 deletions(-)

diff --git a/src/plugins/android/androiddebugsupport.cpp b/src/plugins/android/androiddebugsupport.cpp
index cf441de495b..8459b047433 100644
--- a/src/plugins/android/androiddebugsupport.cpp
+++ b/src/plugins/android/androiddebugsupport.cpp
@@ -82,7 +82,6 @@ RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration *
         params.dumperLibrary = runConfig->dumperLib();
         params.executable = project(runConfig)->rootQt4ProjectNode()->buildDir() + QLatin1String("/app_process");
         params.remoteChannel = runConfig->remoteChannel();
-        params.remoteArchitecture = QLatin1String("arm");
         params.useServerStartScript = true;
 
         params.solibSearchPath.clear();
diff --git a/src/plugins/debugger/debuggerdialogs.cpp b/src/plugins/debugger/debuggerdialogs.cpp
index ef14ff8af96..9b74cd31de1 100644
--- a/src/plugins/debugger/debuggerdialogs.cpp
+++ b/src/plugins/debugger/debuggerdialogs.cpp
@@ -711,12 +711,11 @@ public:
     void toSettings(QSettings *) const;
     void fromSettings(const QSettings *settings);
 
+    Id profileId;
     QString localExecutable;
-    QString remoteArchitecture;
     QString overrideStartScript;
     bool useServerStartScript;
     QString serverStartScript;
-    Id profileId;
     QString debugInfoLocation;
 };
 
@@ -746,7 +745,6 @@ StartRemoteParameters::StartRemoteParameters() :
 bool StartRemoteParameters::equals(const StartRemoteParameters &rhs) const
 {
     return localExecutable == rhs.localExecutable
-            && remoteArchitecture == rhs.remoteArchitecture
             && overrideStartScript == rhs.overrideStartScript
             && useServerStartScript == rhs.useServerStartScript
             && serverStartScript == rhs.serverStartScript
@@ -763,7 +761,6 @@ QString StartRemoteParameters::displayName() const
 void StartRemoteParameters::toSettings(QSettings *settings) const
 {
     settings->setValue(_("LastLocalExecutable"), localExecutable);
-    settings->setValue(_("LastRemoteArchitecture"), remoteArchitecture);
     settings->setValue(_("LastServerStartScript"), serverStartScript);
     settings->setValue(_("LastUseServerStartScript"), useServerStartScript);
     settings->setValue(_("LastRemoteStartScript"), overrideStartScript);
@@ -780,7 +777,6 @@ void StartRemoteParameters::fromSettings(const QSettings *settings)
     } else {
         profileId = Id(profileIdString);
     }
-    remoteArchitecture = settings->value(_("LastRemoteArchitecture")).toString();
     serverStartScript = settings->value(_("LastServerStartScript")).toString();
     useServerStartScript = settings->value(_("LastUseServerStartScript")).toBool();
     overrideStartScript = settings->value(_("LastRemoteStartScript")).toString();
@@ -793,7 +789,6 @@ class StartRemoteDialogPrivate
 public:
     ProfileChooser *profileChooser;
     PathChooser *executablePathChooser;
-    QComboBox *architectureComboBox;
     PathChooser *debuginfoPathChooser;
     PathChooser *overrideStartScriptPathChooser;
     QCheckBox *useServerStartScriptCheckBox;
@@ -816,9 +811,6 @@ StartRemoteDialog::StartRemoteDialog(QWidget *parent, bool enableStartScript)
     d->executablePathChooser->setExpectedKind(PathChooser::File);
     d->executablePathChooser->setPromptDialogTitle(tr("Select Executable"));
 
-    d->architectureComboBox = new QComboBox(this);
-    d->architectureComboBox->setEditable(true);
-
     d->debuginfoPathChooser = new PathChooser(this);
     d->debuginfoPathChooser->setPromptDialogTitle(tr("Select Location of Debugging Information"));
 
@@ -855,7 +847,6 @@ StartRemoteDialog::StartRemoteDialog(QWidget *parent, bool enableStartScript)
     formLayout->addRow(tr("Target:"), d->profileChooser);
     formLayout->addRow(tr("Local &executable:"), d->executablePathChooser);
     formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
-    formLayout->addRow(tr("&Architecture:"), d->architectureComboBox);
     formLayout->addRow(tr("Location of debugging &information:"), d->debuginfoPathChooser);
     formLayout->addRow(tr("Override host GDB s&tart script:"), d->overrideStartScriptPathChooser);
     formLayout->addRow(d->serverStartScriptLabel, d->useServerStartScriptCheckBox);
@@ -890,19 +881,11 @@ bool StartRemoteDialog::run(QWidget *parent, QSettings *settings,
     const QString arrayName = useScript ?
         _("StartRemoteScript") : _("StartRemote");
 
-    QStringList arches;
-    arches << _("i386:x86-64:intel") << _("i386") << _("arm");
-
     QList<StartRemoteParameters> history =
         readParameterHistory<StartRemoteParameters>(settings, settingsGroup, arrayName);
     QTC_ASSERT(!history.isEmpty(), return false);
 
-    foreach (const StartRemoteParameters &h, history)
-        if (!arches.contains(h.remoteArchitecture))
-            arches.prepend(h.remoteArchitecture);
-
     StartRemoteDialog dialog(parent, useScript);
-    dialog.setRemoteArchitectures(arches);
     dialog.setHistory(history);
     dialog.setParameters(history.back());
     if (dialog.exec() != QDialog::Accepted)
@@ -917,7 +900,6 @@ bool StartRemoteDialog::run(QWidget *parent, QSettings *settings,
     }
 
     fillParameters(sp, dialog.profileId());
-    sp->remoteArchitecture = newParameters.remoteArchitecture;
     sp->executable = newParameters.localExecutable;
     sp->displayName = tr("Remote: \"%1\"").arg(sp->remoteChannel);
     sp->overrideStartScript = newParameters.overrideStartScript;
@@ -931,7 +913,6 @@ StartRemoteParameters StartRemoteDialog::parameters() const
 {
     StartRemoteParameters result;
     result.localExecutable = d->executablePathChooser->path();
-    result.remoteArchitecture = d->architectureComboBox->currentText();
     result.overrideStartScript = d->overrideStartScriptPathChooser->path();
     result.useServerStartScript = d->useServerStartScriptCheckBox->isChecked();
     result.serverStartScript = d->serverStartScriptPathChooser->path();
@@ -943,9 +924,6 @@ StartRemoteParameters StartRemoteDialog::parameters() const
 void StartRemoteDialog::setParameters(const StartRemoteParameters &p)
 {
     d->executablePathChooser->setPath(p.localExecutable);
-    const int index = d->architectureComboBox->findText(p.remoteArchitecture);
-    if (index != -1)
-        d->architectureComboBox->setCurrentIndex(index);
     d->overrideStartScriptPathChooser->setPath(p.overrideStartScript);
     d->useServerStartScriptCheckBox->setChecked(p.useServerStartScript);
     d->serverStartScriptPathChooser->setPath(p.serverStartScript);
@@ -974,15 +952,6 @@ Id StartRemoteDialog::profileId() const
     return d->profileChooser->currentProfileId();
 }
 
-void StartRemoteDialog::setRemoteArchitectures(const QStringList &list)
-{
-    d->architectureComboBox->clear();
-    if (!list.isEmpty()) {
-        d->architectureComboBox->insertItems(0, list);
-        d->architectureComboBox->setCurrentIndex(0);
-    }
-}
-
 void StartRemoteDialog::updateState()
 {
     bool enabled = d->useServerStartScriptCheckBox->isChecked();
diff --git a/src/plugins/debugger/debuggerdialogs.h b/src/plugins/debugger/debuggerdialogs.h
index d97fd9cbe44..3b8ba8084a9 100644
--- a/src/plugins/debugger/debuggerdialogs.h
+++ b/src/plugins/debugger/debuggerdialogs.h
@@ -140,8 +140,6 @@ private:
     void setParameters(const StartRemoteParameters &);
     void setHistory(const QList<StartRemoteParameters> &);
 
-    void setRemoteArchitectures(const QStringList &list);
-
     Core::Id profileId() const;
 
     StartRemoteDialogPrivate *d;
diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp
index 1616a1fd7b2..9137c60f0f1 100644
--- a/src/plugins/debugger/debuggerengine.cpp
+++ b/src/plugins/debugger/debuggerengine.cpp
@@ -126,7 +126,6 @@ QDebug operator<<(QDebug str, const DebuggerStartParameters &sp)
             << " attachPID=" << sp.attachPID
             << " useTerminal=" << sp.useTerminal
             << " remoteChannel=" << sp.remoteChannel
-            << " remoteArchitecture=" << sp.remoteArchitecture
             << " symbolFileName=" << sp.symbolFileName
             << " useServerStartScript=" << sp.useServerStartScript
             << " serverStartScript=" << sp.serverStartScript
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index 74745813820..5284797f7ac 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -784,7 +784,6 @@ public slots:
     Q_SLOT void attachExternalApplication(ProjectExplorer::RunControl *rc);
     void runScheduled();
     void attachCore();
-    void attachToRemoteServer(const QString &spec);
 
     void enableReverseDebuggingTriggered(const QVariant &value);
     void languagesChanged();
@@ -1315,7 +1314,7 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it,
 {
     const QString &option = *it;
     // '-debug <pid>'
-    // '-debug <exe>[,server=<server:port>|,core=<core>][,arch=<arch>][,profile=<profile>]'
+    // '-debug <exe>[,server=<server:port>][,core=<core>][,profile=<profile>]'
     if (*it == _("-debug")) {
         ++it;
         if (it == cend) {
@@ -1353,8 +1352,6 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it,
                     sp.displayName = tr("Remote: \"%1\"").arg(sp.remoteChannel);
                     sp.startMessage = tr("Attaching to remote server %1.").arg(sp.remoteChannel);
                 }
-                else if (key == QLatin1String("arch"))
-                    sp.remoteArchitecture = val;
                 else if (key == QLatin1String("core")) {
                     sp.startMode = AttachCore;
                     sp.closeMode = DetachAtClose;
@@ -1598,22 +1595,6 @@ void DebuggerPluginPrivate::attachCore()
         startDebugger(rc);
 }
 
-void DebuggerPluginPrivate::attachToRemoteServer(const QString &spec)
-{
-    // spec is: profile@server:port@executable@architecture
-    const QChar delim(QLatin1Char('@'));
-    DebuggerStartParameters sp;
-    fillParameters(&sp, Id(spec.section(delim, 0, 0)));
-    sp.remoteChannel = spec.section(delim, 1, 1);
-    sp.executable = spec.section(delim, 2, 2);
-    sp.remoteArchitecture = spec.section(delim, 3, 3);
-    sp.displayName = tr("Remote: \"%1\"").arg(sp.remoteChannel);
-    sp.startMode = AttachToRemoteServer;
-    sp.closeMode = KillAtClose;
-    if (DebuggerRunControl *rc = createDebugger(sp))
-        startDebugger(rc);
-}
-
 struct RemoteCdbMatcher : ProfileMatcher
 {
     RemoteCdbMatcher() : m_hostAbi(Abi::hostAbi()) {}
@@ -2734,8 +2715,7 @@ static QString formatStartParameters(DebuggerStartParameters &sp)
         str << "QML server: " << sp.qmlServerAddress << ':'
             << sp.qmlServerPort << '\n';
     if (!sp.remoteChannel.isEmpty()) {
-        str << "Remote: " << sp.remoteChannel << ", "
-            << sp.remoteArchitecture << '\n';
+        str << "Remote: " << sp.remoteChannel << '\n';
         if (!sp.remoteDumperLib.isEmpty())
             str << "Remote dumpers: " << sp.remoteDumperLib << '\n';
         if (!sp.remoteSourcesDir.isEmpty())
diff --git a/src/plugins/debugger/debuggerstartparameters.h b/src/plugins/debugger/debuggerstartparameters.h
index c479e37480b..87787b848a9 100644
--- a/src/plugins/debugger/debuggerstartparameters.h
+++ b/src/plugins/debugger/debuggerstartparameters.h
@@ -111,7 +111,6 @@ public:
     QString qtInstallPath;
     // Used by remote debugging.
     QString remoteChannel;
-    QString remoteArchitecture;
     QString gnuTarget;
     QString symbolFileName;
     bool useServerStartScript;
diff --git a/src/plugins/qnx/blackberryruncontrolfactory.cpp b/src/plugins/qnx/blackberryruncontrolfactory.cpp
index d1abfc3046c..2e649682f10 100644
--- a/src/plugins/qnx/blackberryruncontrolfactory.cpp
+++ b/src/plugins/qnx/blackberryruncontrolfactory.cpp
@@ -134,10 +134,8 @@ Debugger::DebuggerStartParameters BlackBerryRunControlFactory::startParameters(
     params.debuggerCommand = Debugger::DebuggerProfileInformation::debuggerCommand(profile).toString();
     params.sysRoot = ProjectExplorer::SysRootProfileInformation::sysRoot(profile).toString();
 
-    if (ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(profile)) {
+    if (ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(profile))
         params.toolChainAbi = tc->targetAbi();
-        params.remoteArchitecture = ProjectExplorer::Abi::toString(tc->targetAbi().architecture());
-    }
 
     params.executable = runConfig->localExecutableFilePath();
     params.remoteChannel = runConfig->deployConfiguration()->deviceHost() + QLatin1String(":8000");
diff --git a/src/plugins/qnx/qnxruncontrolfactory.cpp b/src/plugins/qnx/qnxruncontrolfactory.cpp
index b0125af6c83..2d95b48609f 100644
--- a/src/plugins/qnx/qnxruncontrolfactory.cpp
+++ b/src/plugins/qnx/qnxruncontrolfactory.cpp
@@ -132,10 +132,8 @@ Debugger::DebuggerStartParameters QnxRunControlFactory::startParameters(
     params.debuggerCommand = Debugger::DebuggerProfileInformation::debuggerCommand(profile).toString();
     params.sysRoot = ProjectExplorer::SysRootProfileInformation::sysRoot(profile).toString();
 
-    if (ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(profile)) {
+    if (ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainProfileInformation::toolChain(profile))
         params.toolChainAbi = tc->targetAbi();
-        params.remoteArchitecture = ProjectExplorer::Abi::toString(tc->targetAbi().architecture());
-    }
 
     params.symbolFileName = runConfig->localExecutableFilePath();
     params.remoteExecutable = runConfig->remoteExecutableFilePath();
diff --git a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp
index 943ab9234ed..3251cfeb9b3 100644
--- a/src/plugins/remotelinux/remotelinuxdebugsupport.cpp
+++ b/src/plugins/remotelinux/remotelinuxdebugsupport.cpp
@@ -122,7 +122,6 @@ DebuggerStartParameters AbstractRemoteLinuxDebugSupport::startParameters(const R
         ToolChain *tc = ToolChainProfileInformation::toolChain(profile);
         if (tc) {
             const Abi &abi = tc->targetAbi();
-            params.remoteArchitecture = abi.toString();
             params.gnuTarget = QLatin1String(abi.architecture() == Abi::ArmArchitecture
                                              ? "arm-none-linux-gnueabi": "i386-unknown-linux-gnu");
         }
-- 
GitLab