Commit 08f8b78f authored by hjk's avatar hjk Committed by hjk
Browse files

debugger: pass selected gdbserver port back to debugger plugin



Change-Id: I9e5fe3c360b901042541776eb61ea9d606de221d
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@nokia.com>
parent f8a1b943
......@@ -97,12 +97,20 @@ void RemoteLinuxPlugin::extensionsInitialized()
const Context globalcontext(Core::Constants::C_GLOBAL);
QAction *startGdbServerAction = new QAction(tr("Start Remote Debug Server..."), 0);
Command *cmd = am->registerAction(startGdbServerAction, "StartGdbServer", globalcontext);
QAction *act = 0;
Command *cmd = 0;
act = new QAction(tr("Start Remote Debug Server..."), 0);
cmd = am->registerAction(act, "StartGdbServer", globalcontext);
cmd->setDefaultText(tr("Start Gdbserver"));
mstart->addAction(cmd, Debugger::Constants::G_MANUAL_REMOTE);
connect(act, SIGNAL(triggered()), SLOT(startGdbServer()));
connect(startGdbServerAction, SIGNAL(triggered()), SLOT(startGdbServer()));
act = new QAction(tr("Attach to Running Remote Process..."), 0);
cmd = am->registerAction(act, "AttachRemoteProcess", globalcontext);
cmd->setDefaultText(tr("Attach to Remote Process"));
mstart->addAction(cmd, Debugger::Constants::G_AUTOMATIC_REMOTE);
connect(act, SIGNAL(triggered()), SLOT(startGdbServer()));
}
void RemoteLinuxPlugin::startGdbServer()
......
......@@ -39,6 +39,8 @@
#include "remotelinuxusedportsgatherer.h"
#include "portlist.h"
#include <extensionsystem/pluginmanager.h>
#include <utils/ssh/sshconnection.h>
#include <utils/ssh/sshremoteprocessrunner.h>
#include <utils/qtcassert.h>
......@@ -200,6 +202,12 @@ void StartGdbServerDialog::startGdbServer()
d->gatherer.start(Utils::SshConnection::create(device->sshParameters()), device);
}
void StartGdbServerDialog::attachToRemoteProcess()
{
LinuxDeviceConfiguration::ConstPtr device = d->currentDevice();
d->gatherer.start(Utils::SshConnection::create(device->sshParameters()), device);
}
void StartGdbServerDialog::handleConnectionError()
{
d->ui.textBrowser->append(tr("Connection error: %1")
......@@ -227,6 +235,13 @@ void StartGdbServerDialog::handleProcessErrorOutput(const QByteArray &ba)
int port = ba.mid(pos + 18).trimmed().toInt();
d->ui.textBrowser->append(tr("Port %1 is now accessible.").arg(port));
emit portOpened(port);
ExtensionSystem::PluginManager *pm =
ExtensionSystem::PluginManager::instance();
QObject *ob = pm->getObjectByName("DebuggerCore");
qDebug() << "FOUND DEBUGGER CORE: " << ob;
if (ob)
QMetaObject::invokeMethod(ob, "gdbServerStarted", Qt::QueuedConnection,
Q_ARG(int, port));
}
}
......
......@@ -52,6 +52,7 @@ public:
~StartGdbServerDialog();
void startGdbServer();
void attachToRemoteProcess();
signals:
void pidSelected(int pid);
......
Supports Markdown
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