aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/debugger/debuggerplugin.cpp
diff options
context:
space:
mode:
authorhjk <[email protected]>2012-07-27 00:17:12 +0200
committerChristian Kandeler <[email protected]>2012-07-31 14:33:03 +0200
commit1283233f4b0194d82c57af1e4be9907bb63e2ffb (patch)
treeac53dec02abad63260093dfd51023d718bdc840d /src/plugins/debugger/debuggerplugin.cpp
parent59187d18d5fcc257eec82f83b35f6d08330e339a (diff)
debugger: move startgdbserverdialog from remotelinux plugins
Change-Id: Ic382437bb99fe1b6bda9b1252e286cb3b9476191 Reviewed-by: Christian Kandeler <[email protected]>
Diffstat (limited to 'src/plugins/debugger/debuggerplugin.cpp')
-rw-r--r--src/plugins/debugger/debuggerplugin.cpp90
1 files changed, 6 insertions, 84 deletions
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index 110b6c392b5..fcf367051a0 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -67,6 +67,7 @@
#include "snapshothandler.h"
#include "threadshandler.h"
#include "commonoptionspage.h"
+#include "gdb/startgdbserverdialog.h"
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/actionmanager/actioncontainer.h>
@@ -1093,16 +1094,11 @@ public slots:
unsigned *enabledEngines, QString *errorMessage);
DebuggerToolTipManager *toolTipManager() const { return m_toolTipManager; }
- virtual QSharedPointer<GlobalDebuggerOptions> globalDebuggerOptions() const { return m_globalDebuggerOptions; }
+ QSharedPointer<GlobalDebuggerOptions> globalDebuggerOptions() const { return m_globalDebuggerOptions; }
// FIXME: Remove.
void maybeEnrichParameters(DebuggerStartParameters *sp);
- void gdbServerStarted(const QString &channel, const QString &profile,
- const QString &remoteCommandLine, const QString &remoteExecutable);
- void attachedToProcess(const QString &channel, const QString &profile,
- const QString &remoteCommandLine, const QString &remoteExecutable);
-
void updateQmlActions() {
action(QmlUpdateOnSave)->setEnabled(boolSetting(ShowQmlObjectTree));
}
@@ -1671,88 +1667,14 @@ void DebuggerPluginPrivate::attachToRemoteServer()
void DebuggerPluginPrivate::startRemoteServer()
{
- QObject *rl = PluginManager::getObjectByName(_("RemoteLinuxPlugin"));
- QTC_ASSERT(rl, return);
- QMetaObject::invokeMethod(rl, "startGdbServer", Qt::QueuedConnection);
- // Will call back gdbServerStarted() below.
-}
-
-void DebuggerPluginPrivate::gdbServerStarted(const QString &channel,
- const QString &profileId,
- const QString &remoteCommandLine,
- const QString &remoteExecutable)
-{
- Q_UNUSED(remoteCommandLine);
- Q_UNUSED(remoteExecutable);
- Q_UNUSED(profileId);
- showStatusMessage(tr("gdbserver is now listening at %1").arg(channel));
+ StartGdbServerDialog dlg(mainWindow());
+ dlg.startGdbServer();
}
void DebuggerPluginPrivate::attachToRemoteProcess()
{
- QObject *rl = PluginManager::getObjectByName(_("RemoteLinuxPlugin"));
- QTC_ASSERT(rl, return);
- QMetaObject::invokeMethod(rl, "attachToRemoteProcess", Qt::QueuedConnection);
- // This will call back attachedToProcess() below.
-}
-
-void DebuggerPluginPrivate::attachedToProcess(const QString &channel,
- const QString &profileId,
- const QString &remoteCommandLine,
- const QString &remoteExecutable)
-{
- Profile *profile = ProfileManager::instance()->find(Id(profileId));
- QTC_ASSERT(profile, return);
- QString sysroot = SysRootProfileInformation::sysRoot(profile).toString();
- QString binary;
- QString localExecutable;
- QString candidate = sysroot + remoteExecutable;
- if (QFileInfo(candidate).exists())
- localExecutable = candidate;
- if (localExecutable.isEmpty()) {
- binary = remoteCommandLine.section(QLatin1Char(' '), 0, 0);
- candidate = sysroot + QLatin1Char('/') + binary;
- if (QFileInfo(candidate).exists())
- localExecutable = candidate;
- }
- if (localExecutable.isEmpty()) {
- candidate = sysroot + QLatin1String("/usr/bin/") + binary;
- if (QFileInfo(candidate).exists())
- localExecutable = candidate;
- }
- if (localExecutable.isEmpty()) {
- candidate = sysroot + QLatin1String("/bin/") + binary;
- if (QFileInfo(candidate).exists())
- localExecutable = candidate;
- }
- if (localExecutable.isEmpty()) {
- QMessageBox::warning(mainWindow(), tr("Warning"),
- tr("Cannot find local executable for remote process \"%1\".")
- .arg(remoteCommandLine));
- return;
- }
-
- QList<Abi> abis = Abi::abisOfBinary(Utils::FileName::fromString(localExecutable));
- if (abis.isEmpty()) {
- QMessageBox::warning(mainWindow(), tr("Warning"),
- tr("Cannot find ABI for remote process \"%1\".")
- .arg(remoteCommandLine));
- return;
- }
-
- DebuggerStartParameters sp;
- fillParameters(&sp, Id(profileId));
- sp.displayName = tr("Remote: \"%1\"").arg(channel);
- sp.remoteChannel = channel;
- sp.executable = localExecutable;
- sp.startMode = AttachToRemoteServer;
- sp.closeMode = KillAtClose;
- sp.overrideStartScript.clear();
- sp.useServerStartScript = false;
- sp.serverStartScript.clear();
- //sp.debugInfoLocation = dlg.debugInfoLocation();
- if (RunControl *rc = createDebugger(sp))
- startDebugger(rc);
+ StartGdbServerDialog dlg(mainWindow());
+ dlg.attachToRemoteProcess();
}
void DebuggerPluginPrivate::attachToQmlPort()