aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/debugger/debuggerplugin.cpp
diff options
context:
space:
mode:
authorhjk <[email protected]>2012-07-24 17:02:42 +0200
committerhjk <[email protected]>2012-07-24 17:11:19 +0200
commite3a5e27eb78a7ae828c2c28871332dc878c53c95 (patch)
tree33569093ec912a061db5961584da083216224224 /src/plugins/debugger/debuggerplugin.cpp
parentd1f8e120bfa2c79aec7dabebf9a8f599a44d20b6 (diff)
debugger: merge local and remote core selection
Diffstat (limited to 'src/plugins/debugger/debuggerplugin.cpp')
-rw-r--r--src/plugins/debugger/debuggerplugin.cpp56
1 files changed, 14 insertions, 42 deletions
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index a0a525ed8f2..3e9acd6409c 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -62,7 +62,7 @@
#include "watchutils.h"
#include "debuggertooltipmanager.h"
#include "localsandexpressionswindow.h"
-#include "loadremotecoredialog.h"
+#include "loadcoredialog.h"
#include "snapshothandler.h"
#include "threadshandler.h"
@@ -768,7 +768,6 @@ public slots:
void startRemoteCdbSession();
void startRemoteProcess();
void startRemoteServer();
- void loadRemoteCoreFile();
//bool queryRemoteParameters(DebuggerStartParameters &sp, bool useScript);
void attachToRemoteServer();
void attachToRemoteProcess();
@@ -1121,7 +1120,6 @@ public:
QAction *m_attachToRemoteServerAction;
QAction *m_startRemoteCdbAction;
QAction *m_startRemoteLldbAction;
- QAction *m_loadRemoteCoreAction;
QAction *m_attachToLocalProcessAction;
QAction *m_attachToCoreAction;
QAction *m_detachAction;
@@ -1564,24 +1562,28 @@ void DebuggerPluginPrivate::attachExternalApplication(RunControl *rc)
void DebuggerPluginPrivate::attachCore()
{
AttachCoreDialog dlg(mainWindow());
- dlg.setExecutableFile(configValue(_("LastExternalExecutableFile")).toString());
- dlg.setCoreFile(configValue(_("LastExternalCoreFile")).toString());
- dlg.setProfileIndex(configValue(_("LastExternalProfileIndex")).toInt());
+
+ dlg.setProfileId(Id(configValue(_("LastExternalProfile")).toString()));
+ dlg.setLocalExecutableFile(configValue(_("LastExternalExecutableFile")).toString());
+ dlg.setLocalCoreFile(configValue(_("LastLocalCoreFile")).toString());
+ dlg.setRemoteCoreFile(configValue(_("LastRemoteCoreFile")).toString());
dlg.setOverrideStartScript(configValue(_("LastExternalStartScript")).toString());
if (dlg.exec() != QDialog::Accepted)
return;
- setConfigValue(_("LastExternalExecutableFile"), dlg.executableFile());
- setConfigValue(_("LastExternalCoreFile"), dlg.coreFile());
- setConfigValue(_("LastExternalProfileIndex"), QVariant(dlg.profileIndex()));
+ setConfigValue(_("LastExternalExecutableFile"), dlg.localExecutableFile());
+ setConfigValue(_("LastLocalCoreFile"), dlg.localCoreFile());
+ setConfigValue(_("LastRemoteCoreFile"), dlg.remoteCoreFile());
+ setConfigValue(_("LastExternalProfile"), dlg.profileId().toString());
setConfigValue(_("LastExternalStartScript"), dlg.overrideStartScript());
DebuggerStartParameters sp;
+ QString display = dlg.isLocal() ? dlg.localCoreFile() : dlg.remoteCoreFile();
fillParameters(&sp, dlg.profileId());
- sp.executable = dlg.executableFile();
- sp.coreFile = dlg.coreFile();
- sp.displayName = tr("Core file \"%1\"").arg(dlg.coreFile());
+ sp.executable = dlg.localExecutableFile();
+ sp.coreFile = dlg.localCoreFile();
+ sp.displayName = tr("Core file \"%1\"").arg(display);
sp.startMode = AttachCore;
sp.closeMode = DetachAtClose;
sp.overrideStartScript = dlg.overrideStartScript();
@@ -1694,27 +1696,6 @@ void DebuggerPluginPrivate::gdbServerStarted(const QString &channel,
showStatusMessage(tr("gdbserver is now listening at %1").arg(channel));
}
-void DebuggerPluginPrivate::loadRemoteCoreFile()
-{
- DebuggerStartParameters sp;
- {
- QTemporaryFile localCoreFile(QDir::tempPath() + "/remotecore-XXXXXX");
- localCoreFile.open();
- sp.coreFile = localCoreFile.fileName();
- }
- LoadRemoteCoreFileDialog dlg(mainWindow());
- dlg.setLocalCoreFileName(sp.coreFile);
- if (!dlg.exec())
- return;
- fillParameters(&sp, dlg.profileId());
- sp.displayName = tr("Core file \"%1\"").arg(sp.coreFile);
- sp.startMode = AttachCore;
- sp.closeMode = DetachAtClose;
- //sp.overrideStartScript = dlg.overrideStartScript();
- if (DebuggerRunControl *rc = createDebugger(sp))
- startDebugger(rc);
-}
-
void DebuggerPluginPrivate::attachToRemoteProcess()
{
QObject *rl = PluginManager::getObjectByName(_("RemoteLinuxPlugin"));
@@ -3094,10 +3075,6 @@ void DebuggerPluginPrivate::extensionsInitialized()
act->setText(tr("Attach to Running Remote Process..."));
connect(act, SIGNAL(triggered()), SLOT(attachToRemoteProcess()));
- act = m_loadRemoteCoreAction = new QAction(this);
- act->setText(tr("Load Remote Core File..."));
- connect(act, SIGNAL(triggered()), SLOT(loadRemoteCoreFile()));
-
act = m_attachToQmlPortAction = new QAction(this);
act->setText(tr("Attach to QML Port..."));
connect(act, SIGNAL(triggered()), SLOT(attachToQmlPort()));
@@ -3182,11 +3159,6 @@ void DebuggerPluginPrivate::extensionsInitialized()
cmd->setDescription(tr("Attach to Remote Process"));
mstart->addAction(cmd, Debugger::Constants::G_AUTOMATIC_REMOTE);
- cmd = ActionManager::registerAction(m_loadRemoteCoreAction,
- "Debugger.LoadRemoteCore", globalcontext);
- cmd->setDescription(tr("Load Remote Core File"));
- mstart->addAction(cmd, Debugger::Constants::G_AUTOMATIC_REMOTE);
-
#ifdef WITH_LLDB
cmd = ActionManager::registerAction(m_startRemoteLldbAction,
"Debugger.RemoteLldb", globalcontext);