diff --git a/src/plugins/debugger/debuggerconstants.h b/src/plugins/debugger/debuggerconstants.h index 36bff640ff6e65e320c1edcdb8c5d07b018c9392..0a8063a4447227561c9b0968874d3b14c45d16ec 100644 --- a/src/plugins/debugger/debuggerconstants.h +++ b/src/plugins/debugger/debuggerconstants.h @@ -48,7 +48,8 @@ const char C_QMLDEBUGGER[] = "Qml/JavaScript Debugger"; // Menu Groups const char G_START_LOCAL[] = "Debugger.Group.Start.Local"; -const char G_START_REMOTE[] = "Debugger.Group.Start.Remote"; +const char G_MANUAL_REMOTE[] = "Debugger.Group.Manual.Remote"; +const char G_AUTOMATIC_REMOTE[] = "Debugger.Group.Automatic.Remote"; const char G_START_QML[] = "Debugger.Group.Start.Qml"; // Project Explorer run mode (RUN/DEBUG) @@ -130,8 +131,9 @@ enum DebuggerStartMode AttachExternal, // Attach to running process by process id AttachCrashedExternal, // Attach to crashed process by process id AttachCore, // Attach to a core file - AttachToRemoteServer, // Attach to a running remote server - StartRemote, // Start and attach to a remote process + AttachToRemoteServer, // Attach to a running gdbserver + AttachToRemoteProcess, // Attach to a running remote process + StartRemoteProcess, // Start and attach to a remote process AttachToQmlPort, // Attach to QML debugging port StartRemoteGdb, // Start gdb itself remotely StartRemoteEngine // Start ipc guest engine on other machine diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 187ed776d7286831b5a0f6bbc89fe8e71831fb88..79f3f9e26e3369d887ee4d1a5a1074a8b11d5eb8 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -732,14 +732,15 @@ public slots: void startRemoteCdbSession(); void startRemoteApplication(); bool queryRemoteParameters(DebuggerStartParameters &sp, bool useScript); - void attachRemoteApplication(); + void attachToRemoteServer(); + //void attachToRemoteProcess(); void attachToQmlPort(); void startRemoteEngine(); void attachExternalApplication(); Q_SLOT void attachExternalApplication(ProjectExplorer::RunControl *rc); void runScheduled(); void attachCore(); - void attachRemote(const QString &spec); + void attachToRemoteServer(const QString &spec); void enableReverseDebuggingTriggered(const QVariant &value); void languagesChanged(); @@ -1034,14 +1035,15 @@ public: Utils::ProxyAction *m_hiddenStopAction; QAction *m_startAction; QAction *m_debugWithoutDeployAction; - QAction *m_startExternalAction; - QAction *m_startRemoteAction; + QAction *m_startExternalProcessAction; + QAction *m_startRemoteProcessAction; QAction *m_attachToQmlPortAction; - QAction *m_attachRemoteAction; + QAction *m_attachToRemoteServerAction; + //QAction *m_attachToRemoteProcessAction; QAction *m_startRemoteCdbAction; QAction *m_startRemoteLldbAction; QAction *m_attachExternalAction; - QAction *m_attachCoreAction; + QAction *m_attachToCoreAction; QAction *m_detachAction; QAction *m_continueAction; QAction *m_exitAction; // On application output button if "Stop" is possible @@ -1153,14 +1155,15 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(DebuggerPlugin *plugin) : m_reverseToolButton = 0; m_startAction = 0; m_debugWithoutDeployAction = 0; - m_startExternalAction = 0; - m_startRemoteAction = 0; - m_attachRemoteAction = 0; + m_startExternalProcessAction = 0; + m_startRemoteProcessAction = 0; + m_attachToRemoteServerAction = 0; + //m_attachToRemoteProcessAction = 0; m_attachToQmlPortAction = 0; m_startRemoteCdbAction = 0; m_startRemoteLldbAction = 0; m_attachExternalAction = 0; - m_attachCoreAction = 0; + m_attachToCoreAction = 0; m_detachAction = 0; m_commonOptionsPage = 0; @@ -1204,8 +1207,10 @@ void DebuggerPluginPrivate::maybeEnrichParameters(DebuggerStartParameters *sp) { if (!boolSetting(AutoEnrichParameters)) return; - if (sp->sysroot.isEmpty() && (sp->startMode == AttachToRemoteServer - || sp->startMode == StartRemote)) { + if (sp->sysroot.isEmpty() && + (sp->startMode == AttachToRemoteServer + || sp->startMode == StartRemoteProcess + || sp->startMode == AttachToRemoteProcess)) { // FIXME: Get from BaseQtVersion. sp->sysroot = QString::fromLocal8Bit(qgetenv("QTC_DEBUGGER_SYSROOT")); showMessage(QString::fromLatin1("USING QTC_DEBUGGER_SYSROOT %1") @@ -1547,7 +1552,7 @@ void DebuggerPluginPrivate::attachCore() startDebugger(rc); } -void DebuggerPluginPrivate::attachRemote(const QString &spec) +void DebuggerPluginPrivate::attachToRemoteServer(const QString &spec) { // spec is: server:port@executable@architecture DebuggerStartParameters sp; @@ -1651,14 +1656,14 @@ bool DebuggerPluginPrivate::queryRemoteParameters(DebuggerStartParameters &sp, b void DebuggerPluginPrivate::startRemoteApplication() { DebuggerStartParameters sp; - sp.startMode = StartRemote; + sp.startMode = StartRemoteProcess; if (!queryRemoteParameters(sp, true)) return; if (RunControl *rc = createDebugger(sp)) startDebugger(rc); } -void DebuggerPluginPrivate::attachRemoteApplication() +void DebuggerPluginPrivate::attachToRemoteServer() { DebuggerStartParameters sp; if (!queryRemoteParameters(sp, false)) @@ -1670,6 +1675,22 @@ void DebuggerPluginPrivate::attachRemoteApplication() startDebugger(rc); } +/* +void DebuggerPluginPrivate::attachToRemoteProcess() +{ + + DebuggerStartParameters sp; + if (!queryRemoteParameters(sp, false)) + return; + + sp.startMode = AttachToRemoteProcess; + sp.useServerStartScript = false; + sp.serverStartScript.clear(); + if (RunControl *rc = createDebugger(sp)) + startDebugger(rc); +} +*/ + void DebuggerPluginPrivate::attachToQmlPort() { DebuggerStartParameters sp; @@ -2108,12 +2129,13 @@ void DebuggerPluginPrivate::setInitialState() m_reverseDirectionAction->setEnabled(false); m_toolTipManager->closeAllToolTips(); - m_startExternalAction->setEnabled(true); + m_startExternalProcessAction->setEnabled(true); m_attachExternalAction->setEnabled(true); m_attachToQmlPortAction->setEnabled(true); - m_attachCoreAction->setEnabled(true); - m_startRemoteAction->setEnabled(true); - m_attachRemoteAction->setEnabled(true); + m_attachToCoreAction->setEnabled(true); + m_startRemoteProcessAction->setEnabled(true); + m_attachToRemoteServerAction->setEnabled(true); + //m_attachToRemoteProcessAction->setEnabled(true); m_detachAction->setEnabled(false); m_watchAction1->setEnabled(true); @@ -2232,12 +2254,13 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine) m_hiddenStopAction->setAction(m_undisturbableAction); } - m_startExternalAction->setEnabled(true); + m_startExternalProcessAction->setEnabled(true); m_attachToQmlPortAction->setEnabled(true); m_attachExternalAction->setEnabled(true); - m_attachCoreAction->setEnabled(true); - m_startRemoteAction->setEnabled(true); - m_attachRemoteAction->setEnabled(true); + m_attachToCoreAction->setEnabled(true); + m_startRemoteProcessAction->setEnabled(true); + m_attachToRemoteServerAction->setEnabled(true); + //m_attachToRemoteProcessAction->setEnabled(true); const bool isCore = engine->startParameters().startMode == AttachCore; const bool stopped = state == InferiorStopOk; @@ -2991,7 +3014,7 @@ void DebuggerPluginPrivate::extensionsInitialized() connect(act, SIGNAL(triggered()), this, SLOT(debugProjectWithoutDeploy())); // Handling of external applications. - act = m_startExternalAction = new QAction(this); + act = m_startExternalProcessAction = new QAction(this); act->setText(tr("Start and Debug External Application...")); connect(act, SIGNAL(triggered()), SLOT(startExternalApplication())); @@ -3005,17 +3028,21 @@ void DebuggerPluginPrivate::extensionsInitialized() act->setText(tr("Attach to Running External Application...")); connect(act, SIGNAL(triggered()), SLOT(attachExternalApplication())); - act = m_attachCoreAction = new QAction(this); + act = m_attachToCoreAction = new QAction(this); act->setText(tr("Attach to Core...")); connect(act, SIGNAL(triggered()), SLOT(attachCore())); - act = m_startRemoteAction = new QAction(this); + act = m_startRemoteProcessAction = new QAction(this); act->setText(tr("Start and Debug Remote Application...")); connect(act, SIGNAL(triggered()), SLOT(startRemoteApplication())); - act = m_attachRemoteAction = new QAction(this); + act = m_attachToRemoteServerAction = new QAction(this); act->setText(tr("Attach to Remote Debug Server...")); - connect(act, SIGNAL(triggered()), SLOT(attachRemoteApplication())); + connect(act, SIGNAL(triggered()), SLOT(attachToRemoteServer())); + + //act = m_attachToRemoteProcessAction = new QAction(this); + //act->setText(tr("Attach to Running Remote Process...")); + //connect(act, SIGNAL(triggered()), SLOT(attachToRemoteProcess())); act = m_attachToQmlPortAction = new QAction(this); act->setText(tr("Attach to QML Port...")); @@ -3066,25 +3093,30 @@ void DebuggerPluginPrivate::extensionsInitialized() cmd->setAttribute(Command::CA_Hide); mstart->addAction(cmd, Constants::G_START_LOCAL); - cmd = am->registerAction(m_startExternalAction, + cmd = am->registerAction(m_startExternalProcessAction, "Debugger.StartExternal", globalcontext); cmd->setAttribute(Command::CA_Hide); mstart->addAction(cmd, Constants::G_START_LOCAL); - cmd = am->registerAction(m_attachCoreAction, + cmd = am->registerAction(m_attachToCoreAction, "Debugger.AttachCore", globalcontext); cmd->setAttribute(Command::CA_Hide); mstart->addAction(cmd, Constants::G_START_LOCAL); - cmd = am->registerAction(m_attachRemoteAction, - "Debugger.AttachRemote", globalcontext); + cmd = am->registerAction(m_attachToRemoteServerAction, + "Debugger.AttachToRemoteServer", globalcontext); cmd->setAttribute(Command::CA_Hide); - mstart->addAction(cmd, Constants::G_START_REMOTE); + mstart->addAction(cmd, Constants::G_MANUAL_REMOTE); - cmd = am->registerAction(m_startRemoteAction, - "Debugger.StartRemote", globalcontext); + //cmd = am->registerAction(m_attachToRemoteProcessAction, + // "Debugger.AttachToRemoteProcess", globalcontext); + //cmd->setAttribute(Command::CA_Hide); + //mstart->addAction(cmd, Constants::G_AUTOMATIC_REMOTE); + + cmd = am->registerAction(m_startRemoteProcessAction, + "Debugger.StartRemoteProcess", globalcontext); cmd->setAttribute(Command::CA_Hide); - mstart->addAction(cmd, Constants::G_START_REMOTE); + mstart->addAction(cmd, Constants::G_AUTOMATIC_REMOTE); #ifdef WITH_LLDB @@ -3098,7 +3130,7 @@ void DebuggerPluginPrivate::extensionsInitialized() cmd = am->registerAction(m_startRemoteCdbAction, "Debugger.AttachRemoteCdb", globalcontext); cmd->setAttribute(Command::CA_Hide); - mstart->addAction(cmd, Constants::G_START_REMOTE); + mstart->addAction(cmd, Constants::G_MANUAL_REMOTE); } QAction *sep = new QAction(mstart); @@ -3471,7 +3503,8 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess ActionContainer *mstart = am->actionContainer(PE::M_DEBUG_STARTDEBUGGING); mstart->appendGroup(Constants::G_START_LOCAL); - mstart->appendGroup(Constants::G_START_REMOTE); + mstart->appendGroup(Constants::G_MANUAL_REMOTE); + mstart->appendGroup(Constants::G_AUTOMATIC_REMOTE); mstart->appendGroup(Constants::G_START_QML); // Separators @@ -3479,10 +3512,16 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess sep->setSeparator(true); Command *cmd = am->registerAction(sep, "Debugger.Local.Cpp", globalcontext); mstart->addAction(cmd, Constants::G_START_LOCAL); + sep = new QAction(mstart); sep->setSeparator(true); - cmd = am->registerAction(sep, "Debugger.Remote.Cpp", globalcontext); - mstart->addAction(cmd, Constants::G_START_REMOTE); + cmd = am->registerAction(sep, "Debugger.StartRemote.Cpp", globalcontext); + mstart->addAction(cmd, Constants::G_MANUAL_REMOTE); + + sep = new QAction(mstart); + sep->setSeparator(true); + cmd = am->registerAction(sep, "Debugger.AttachRemote.Cpp", globalcontext); + mstart->addAction(cmd, Constants::G_AUTOMATIC_REMOTE); return theDebuggerCore->initialize(arguments, errorMessage); } diff --git a/src/plugins/debugger/debuggerrunner.cpp b/src/plugins/debugger/debuggerrunner.cpp index 59e63b373e9d7e62f83a2aed7178710635ef8dc3..7c2b2351a3bd1fefc52c2e4617b20534bbab5d99 100644 --- a/src/plugins/debugger/debuggerrunner.cpp +++ b/src/plugins/debugger/debuggerrunner.cpp @@ -457,10 +457,11 @@ static QList<DebuggerEngineType> enginesForMode(DebuggerStartMode startMode, #endif result.push_back(GdbEngineType); break; - case StartRemote: + case StartRemoteProcess: case StartRemoteGdb: result.push_back(GdbEngineType); break; + case AttachToRemoteProcess: case AttachToRemoteServer: if (!hardConstraintsOnly) { #ifdef Q_OS_WIN diff --git a/src/plugins/remotelinux/remotelinuxplugin.cpp b/src/plugins/remotelinux/remotelinuxplugin.cpp index 491a1d0d2f926f3e999b801d53b96ba78871f865..ee3e9cf0505b27943573b68408cc256b629225c7 100644 --- a/src/plugins/remotelinux/remotelinuxplugin.cpp +++ b/src/plugins/remotelinux/remotelinuxplugin.cpp @@ -100,7 +100,7 @@ void RemoteLinuxPlugin::extensionsInitialized() QAction *startGdbServerAction = new QAction(tr("Start Remote Debug Server..."), 0); Command *cmd = am->registerAction(startGdbServerAction, "StartGdbServer", globalcontext); cmd->setDefaultText(tr("Start Gdbserver")); - mstart->addAction(cmd, Debugger::Constants::G_START_REMOTE); + mstart->addAction(cmd, Debugger::Constants::G_MANUAL_REMOTE); connect(startGdbServerAction, SIGNAL(triggered()), SLOT(startGdbServer())); }