forked from qt-creator/qt-creator
debugger: pass selected gdbserver port back to debugger plugin
Change-Id: I9e5fe3c360b901042541776eb61ea9d606de221d Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
This commit is contained in:
@@ -97,12 +97,20 @@ void RemoteLinuxPlugin::extensionsInitialized()
|
|||||||
|
|
||||||
const Context globalcontext(Core::Constants::C_GLOBAL);
|
const Context globalcontext(Core::Constants::C_GLOBAL);
|
||||||
|
|
||||||
QAction *startGdbServerAction = new QAction(tr("Start Remote Debug Server..."), 0);
|
QAction *act = 0;
|
||||||
Command *cmd = am->registerAction(startGdbServerAction, "StartGdbServer", globalcontext);
|
Command *cmd = 0;
|
||||||
|
|
||||||
|
act = new QAction(tr("Start Remote Debug Server..."), 0);
|
||||||
|
cmd = am->registerAction(act, "StartGdbServer", globalcontext);
|
||||||
cmd->setDefaultText(tr("Start Gdbserver"));
|
cmd->setDefaultText(tr("Start Gdbserver"));
|
||||||
mstart->addAction(cmd, Debugger::Constants::G_MANUAL_REMOTE);
|
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()
|
void RemoteLinuxPlugin::startGdbServer()
|
||||||
|
|||||||
@@ -39,6 +39,8 @@
|
|||||||
#include "remotelinuxusedportsgatherer.h"
|
#include "remotelinuxusedportsgatherer.h"
|
||||||
#include "portlist.h"
|
#include "portlist.h"
|
||||||
|
|
||||||
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
|
||||||
#include <utils/ssh/sshconnection.h>
|
#include <utils/ssh/sshconnection.h>
|
||||||
#include <utils/ssh/sshremoteprocessrunner.h>
|
#include <utils/ssh/sshremoteprocessrunner.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
@@ -200,6 +202,12 @@ void StartGdbServerDialog::startGdbServer()
|
|||||||
d->gatherer.start(Utils::SshConnection::create(device->sshParameters()), device);
|
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()
|
void StartGdbServerDialog::handleConnectionError()
|
||||||
{
|
{
|
||||||
d->ui.textBrowser->append(tr("Connection error: %1")
|
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();
|
int port = ba.mid(pos + 18).trimmed().toInt();
|
||||||
d->ui.textBrowser->append(tr("Port %1 is now accessible.").arg(port));
|
d->ui.textBrowser->append(tr("Port %1 is now accessible.").arg(port));
|
||||||
emit portOpened(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();
|
~StartGdbServerDialog();
|
||||||
|
|
||||||
void startGdbServer();
|
void startGdbServer();
|
||||||
|
void attachToRemoteProcess();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void pidSelected(int pid);
|
void pidSelected(int pid);
|
||||||
|
|||||||
Reference in New Issue
Block a user