Commit fd1b9087 authored by hjk's avatar hjk
Browse files

debugger: move most initialization code to extensionsInitialized()

parent dcd95f8d
......@@ -1373,6 +1373,7 @@ public:
DebuggerSettings *m_debuggerSettings;
QSettings *m_coreSettings;
bool m_gdbBinariesChanged;
uint m_cmdLineEnabledEngines;
};
DebuggerPluginPrivate::DebuggerPluginPrivate(DebuggerPlugin *plugin)
......@@ -1412,8 +1413,6 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(DebuggerPlugin *plugin)
m_logWindow = 0;
m_scriptConsoleWindow = 0;
m_debugMode = 0;
m_continuableContext = Context(0);
m_interruptibleContext = Context(0);
m_undisturbableContext = Context(0);
......@@ -1428,6 +1427,7 @@ DebuggerPluginPrivate::DebuggerPluginPrivate(DebuggerPlugin *plugin)
m_debuggerSettings = 0;
m_gdbBinariesChanged = true;
m_cmdLineEnabledEngines = AllEngineTypes;
}
DebuggerPluginPrivate::~DebuggerPluginPrivate()
......@@ -1455,1897 +1455,1895 @@ DebuggerCore *debuggerCore()
bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
QString *errorMessage)
{
m_coreSettings = ICore::instance()->settings();
m_debuggerSettings = new DebuggerSettings(m_coreSettings);
m_continuableContext = Context("Gdb.Continuable");
m_interruptibleContext = Context("Gdb.Interruptible");
m_undisturbableContext = Context("Gdb.Undisturbable");
m_finishedContext = Context("Gdb.Finished");
m_anyContext.add(m_continuableContext);
m_anyContext.add(m_interruptibleContext);
m_anyContext.add(m_undisturbableContext);
m_anyContext.add(m_finishedContext);
// FIXME: Move part of this to extensionsInitialized()?
ICore *core = ICore::instance();
QTC_ASSERT(core, return false);
connect(core, SIGNAL(coreAboutToClose()), this, SLOT(coreShutdown()));
// Do not fail to load the whole plugin if something goes wrong here.
if (!parseArguments(arguments, &m_attachRemoteParameters,
&m_cmdLineEnabledEngines, errorMessage)) {
*errorMessage = tr("Error evaluating command line arguments: %1")
.arg(*errorMessage);
qWarning("%s\n", qPrintable(*errorMessage));
errorMessage->clear();
}
Core::ActionManager *am = core->actionManager();
QTC_ASSERT(am, return false);
return true;
}
const Context globalcontext(CC::C_GLOBAL);
const Context cppDebuggercontext(C_CPPDEBUGGER);
const Context qmlDebuggerContext(C_QMLDEBUGGER);
const Context cppeditorcontext(CppEditor::Constants::C_CPPEDITOR);
void DebuggerPluginPrivate::setConfigValue(const QString &name, const QVariant &value)
{
m_coreSettings->setValue(_("DebugMode/") + name, value);
}
m_startIcon = QIcon(_(":/debugger/images/debugger_start_small.png"));
m_startIcon.addFile(__(":/debugger/images/debugger_start.png"));
m_exitIcon = QIcon(_(":/debugger/images/debugger_stop_small.png"));
m_exitIcon.addFile(__(":/debugger/images/debugger_stop.png"));
m_continueIcon = QIcon(__(":/debugger/images/debugger_continue_small.png"));
m_continueIcon.addFile(__(":/debugger/images/debugger_continue.png"));
m_interruptIcon = QIcon(_(":/debugger/images/debugger_interrupt_small.png"));
m_interruptIcon.addFile(__(":/debugger/images/debugger_interrupt.png"));
m_locationMarkIcon = QIcon(_(":/debugger/images/location_16.png"));
QVariant DebuggerPluginPrivate::configValue(const QString &name) const
{
const QVariant value = m_coreSettings->value(_("DebugMode/") + name);
if (value.isValid())
return value;
// Legacy (pre-2.1): Check old un-namespaced-settings.
return m_coreSettings->value(name);
}
m_busy = false;
void DebuggerPluginPrivate::onCurrentProjectChanged(Project *project)
{
RunConfiguration *activeRc = 0;
if (project) {
Target *target = project->activeTarget();
QTC_ASSERT(target, return);
activeRc = target->activeRunConfiguration();
QTC_ASSERT(activeRc, /**/);
}
for (int i = 0, n = m_snapshotHandler->size(); i != n; ++i) {
// Run controls might be deleted during exit.
if (DebuggerRunControl *runControl = m_snapshotHandler->at(i)) {
RunConfiguration *rc = runControl->runConfiguration();
if (rc == activeRc) {
m_snapshotHandler->setCurrentIndex(i);
DebuggerEngine *engine = runControl->engine();
updateState(engine);
return;
}
}
}
// No corresponding debugger found. So we are ready to start one.
ICore *core = ICore::instance();
core->updateAdditionalContexts(m_anyContext, Context());
}
m_statusLabel = new QLabel;
m_statusLabel->setMinimumSize(QSize(30, 10));
void DebuggerPluginPrivate::languagesChanged(const DebuggerLanguages &languages)
{
const bool debuggerIsCPP = (languages & CppLanguage);
//qDebug() << "DEBUGGER IS CPP: " << debuggerIsCPP;
m_breakHandler = new BreakHandler;
m_breakWindow = new BreakWindow;
m_breakWindow->setObjectName(QLatin1String("CppDebugBreakpoints"));
m_breakWindow->setModel(m_breakHandler->model());
m_startExternalAction->setVisible(debuggerIsCPP);
m_attachExternalAction->setVisible(debuggerIsCPP);
m_attachCoreAction->setVisible(debuggerIsCPP);
m_startRemoteAction->setVisible(debuggerIsCPP);
m_detachAction->setVisible(debuggerIsCPP);
}
//m_consoleWindow = new ConsoleWindow;
//m_consoleWindow->setObjectName(QLatin1String("CppDebugConsole"));
m_modulesWindow = new ModulesWindow;
m_modulesWindow->setObjectName(QLatin1String("CppDebugModules"));
m_logWindow = new LogWindow;
m_logWindow->setObjectName(QLatin1String("CppDebugOutput"));
void DebuggerPluginPrivate::debugProject()
{
ProjectExplorerPlugin *pe = ProjectExplorerPlugin::instance();
if (Project *pro = pe->startupProject())
pe->runProject(pro, Constants::DEBUGMODE);
}
m_registerWindow = new RegisterWindow;
m_registerWindow->setObjectName(QLatin1String("CppDebugRegisters"));
m_stackWindow = new StackWindow;
m_stackWindow->setObjectName(QLatin1String("CppDebugStack"));
m_sourceFilesWindow = new SourceFilesWindow;
m_sourceFilesWindow->setObjectName(QLatin1String("CppDebugSources"));
m_threadsWindow = new ThreadsWindow;
m_threadsWindow->setObjectName(QLatin1String("CppDebugThreads"));
m_returnWindow = new WatchWindow(WatchWindow::ReturnType);
m_returnWindow->setObjectName(QLatin1String("CppDebugReturn"));
m_localsWindow = new WatchWindow(WatchWindow::LocalsType);
m_localsWindow->setObjectName(QLatin1String("CppDebugLocals"));
m_watchersWindow = new WatchWindow(WatchWindow::WatchersType);
m_watchersWindow->setObjectName(QLatin1String("CppDebugWatchers"));
m_scriptConsoleWindow = new ScriptConsole;
m_scriptConsoleWindow->setWindowTitle(tr("QML Script Console"));
m_scriptConsoleWindow->setObjectName(QLatin1String("QMLScriptConsole"));
connect(m_scriptConsoleWindow, SIGNAL(expressionEntered(QString)),
SLOT(scriptExpressionEntered(QString)));
void DebuggerPluginPrivate::startExternalApplication()
{
DebuggerStartParameters sp;
StartExternalDialog dlg(mainWindow());
dlg.setExecutableFile(
configValue(_("LastExternalExecutableFile")).toString());
dlg.setExecutableArguments(
configValue(_("LastExternalExecutableArguments")).toString());
dlg.setWorkingDirectory(
configValue(_("LastExternalWorkingDirectory")).toString());
if (dlg.exec() != QDialog::Accepted)
return;
// Snapshot
m_snapshotHandler = new SnapshotHandler;
m_snapshotWindow = new SnapshotWindow(m_snapshotHandler);
m_snapshotWindow->setObjectName(QLatin1String("CppDebugSnapshots"));
m_snapshotWindow->setModel(m_snapshotHandler->model());
setConfigValue(_("LastExternalExecutableFile"),
dlg.executableFile());
setConfigValue(_("LastExternalExecutableArguments"),
dlg.executableArguments());
setConfigValue(_("LastExternalWorkingDirectory"),
dlg.workingDirectory());
sp.executable = dlg.executableFile();
sp.startMode = StartExternal;
sp.workingDirectory = dlg.workingDirectory();
sp.breakAtMain = dlg.breakAtMain();
if (!dlg.executableArguments().isEmpty())
sp.processArgs = dlg.executableArguments();
// Fixme: 1 of 3 testing hacks.
if (sp.processArgs.startsWith(__("@tcf@ ")) || sp.processArgs.startsWith(__("@sym@ ")))
sp.toolChainType = ToolChain_RVCT2_ARMV5;
// Debug mode setup
m_debugMode = new DebugMode(this);
// Watchers
connect(m_localsWindow->header(), SIGNAL(sectionResized(int,int,int)),
SLOT(updateWatchersHeader(int,int,int)), Qt::QueuedConnection);
if (RunControl *rc = m_debuggerRunControlFactory->create(sp))
startDebugger(rc);
}
QAction *act = 0;
void DebuggerPluginPrivate::attachExternalApplication()
{
AttachExternalDialog dlg(mainWindow());
if (dlg.exec() == QDialog::Accepted)
attachExternalApplication(dlg.attachPID(), dlg.executable(), QString());
}
act = m_actions.continueAction = new QAction(tr("Continue"), this);
act->setIcon(m_continueIcon);
connect(act, SIGNAL(triggered()), SLOT(handleExecContinue()));
void DebuggerPluginPrivate::attachExternalApplication
(qint64 pid, const QString &binary, const QString &crashParameter)
{
if (pid == 0) {
QMessageBox::warning(mainWindow(), tr("Warning"),
tr("Cannot attach to PID 0"));
return;
}
DebuggerStartParameters sp;
sp.attachPID = pid;
sp.displayName = tr("Process %1").arg(pid);
sp.executable = binary;
sp.crashParameter = crashParameter;
sp.startMode = crashParameter.isEmpty() ? AttachExternal : AttachCrashedExternal;
if (DebuggerRunControl *rc = createDebugger(sp))
startDebugger(rc);
}
act = m_actions.exitAction = new QAction(tr("Exit Debugger"), this);
act->setIcon(m_exitIcon);
connect(act, SIGNAL(triggered()), SLOT(handleExecExit()));
void DebuggerPluginPrivate::attachCore()
{
AttachCoreDialog dlg(mainWindow());
dlg.setExecutableFile(configValue(_("LastExternalExecutableFile")).toString());
dlg.setCoreFile(configValue(_("LastExternalCoreFile")).toString());
if (dlg.exec() != QDialog::Accepted)
return;
setConfigValue(_("LastExternalExecutableFile"), dlg.executableFile());
setConfigValue(_("LastExternalCoreFile"), dlg.coreFile());
attachCore(dlg.coreFile(), dlg.executableFile());
}
act = m_actions.interruptAction = new QAction(tr("Interrupt"), this);
act->setIcon(m_interruptIcon);
connect(act, SIGNAL(triggered()), SLOT(handleExecInterrupt()));
void DebuggerPluginPrivate::attachCore(const QString &core, const QString &exe)
{
DebuggerStartParameters sp;
sp.executable = exe;
sp.coreFile = core;
sp.displayName = tr("Core file \"%1\"").arg(core);
sp.startMode = AttachCore;
if (DebuggerRunControl *rc = createDebugger(sp))
startDebugger(rc);
}
// A "disabled pause" seems to be a good choice.
act = m_actions.undisturbableAction = new QAction(tr("Debugger is Busy"), this);
act->setIcon(m_interruptIcon);
act->setEnabled(false);
void DebuggerPluginPrivate::attachRemote(const QString &spec)
{
// spec is: executable@server:port@architecture
DebuggerStartParameters sp;
sp.executable = spec.section('@', 0, 0);
sp.remoteChannel = spec.section('@', 1, 1);
sp.remoteArchitecture = spec.section('@', 2, 2);
sp.displayName = tr("Remote: \"%1\"").arg(sp.remoteChannel);
sp.startMode = AttachToRemote;
if (DebuggerRunControl *rc = createDebugger(sp))
startDebugger(rc);
}
act = m_actions.resetAction = new QAction(tr("Abort Debugging"), this);
act->setToolTip(tr("Aborts debugging and "
"resets the debugger to the initial state."));
connect(act, SIGNAL(triggered()), SLOT(handleExecReset()));
void DebuggerPluginPrivate::startRemoteCdbSession()
{
const QString connectionKey = _("CdbRemoteConnection");
DebuggerStartParameters sp;
sp.toolChainType = ToolChain_MSVC;
sp.startMode = AttachToRemote;
StartRemoteCdbDialog dlg(mainWindow());
QString previousConnection = configValue(connectionKey).toString();
if (previousConnection.isEmpty())
previousConnection = QLatin1String("localhost:1234");
dlg.setConnection(previousConnection);
if (dlg.exec() != QDialog::Accepted)
return;
sp.remoteChannel = dlg.connection();
setConfigValue(connectionKey, sp.remoteChannel);
if (RunControl *rc = createDebugger(sp))
startDebugger(rc);
}
act = m_actions.nextAction = new QAction(tr("Step Over"), this);
act->setIcon(QIcon(__(":/debugger/images/debugger_stepover_small.png")));
connect(act, SIGNAL(triggered()), SLOT(handleExecNext()));
act = m_actions.stepAction = new QAction(tr("Step Into"), this);
act->setIcon(QIcon(__(":/debugger/images/debugger_stepinto_small.png")));
connect(act, SIGNAL(triggered()), SLOT(handleExecStep()));
act = m_actions.stepOutAction = new QAction(tr("Step Out"), this);
act->setIcon(QIcon(__(":/debugger/images/debugger_stepout_small.png")));
connect(act, SIGNAL(triggered()), SLOT(handleExecStepOut()));
act = m_actions.runToLineAction = new QAction(tr("Run to Line"), this);
connect(act, SIGNAL(triggered()), SLOT(handleExecRunToLine()));
act = m_actions.runToFunctionAction =
new QAction(tr("Run to Outermost Function"), this);
connect(act, SIGNAL(triggered()), SLOT(handleExecRunToFunction()));
act = m_actions.returnFromFunctionAction =
new QAction(tr("Immediately Return From Inner Function"), this);
connect(act, SIGNAL(triggered()), SLOT(handleExecReturn()));
act = m_actions.jumpToLineAction = new QAction(tr("Jump to Line"), this);
connect(act, SIGNAL(triggered()), SLOT(handleExecJumpToLine()));
act = m_actions.breakAction = new QAction(tr("Toggle Breakpoint"), this);
act = m_actions.watchAction1 = new QAction(tr("Add to Watch Window"), this);
connect(act, SIGNAL(triggered()), SLOT(handleAddToWatchWindow()));
act = m_actions.watchAction2 = new QAction(tr("Add to Watch Window"), this);
connect(act, SIGNAL(triggered()), SLOT(handleAddToWatchWindow()));
//m_actions.snapshotAction = new QAction(tr("Create Snapshot"), this);
//m_actions.snapshotAction->setProperty(Role, RequestCreateSnapshotRole);
//m_actions.snapshotAction->setIcon(
// QIcon(__(":/debugger/images/debugger_snapshot_small.png")));
act = m_actions.reverseDirectionAction =
new QAction(tr("Reverse Direction"), this);
act->setCheckable(true);
act->setChecked(false);
act->setCheckable(false);
act->setIcon(QIcon(__(":/debugger/images/debugger_reversemode_16.png")));
act->setIconVisibleInMenu(false);
act = m_actions.frameDownAction = new QAction(tr("Move to Called Frame"), this);
connect(act, SIGNAL(triggered()), SLOT(handleFrameDown()));
act = m_actions.frameUpAction = new QAction(tr("Move to Calling Frame"), this);
connect(act, SIGNAL(triggered()), SLOT(handleFrameUp()));
connect(action(OperateByInstruction), SIGNAL(triggered(bool)),
SLOT(handleOperateByInstructionTriggered(bool)));
connect(&m_statusTimer, SIGNAL(timeout()), SLOT(clearStatusMessage()));
void DebuggerPluginPrivate::startRemoteApplication()
{
DebuggerStartParameters sp;
StartRemoteDialog dlg(mainWindow());
QStringList arches;
arches.append(_("i386:x86-64:intel"));
arches.append(_("i386"));
arches.append(_("arm"));
QString lastUsed = configValue(_("LastRemoteArchitecture")).toString();
if (!arches.contains(lastUsed))
arches.prepend(lastUsed);
dlg.setRemoteArchitectures(arches);
QStringList gnuTargets;
gnuTargets.append(_("auto"));
gnuTargets.append(_("i686-linux-gnu"));
gnuTargets.append(_("x86_64-linux-gnu"));
gnuTargets.append(_("arm-none-linux-gnueabi"));
const QString lastUsedGnuTarget
= configValue(_("LastGnuTarget")).toString();
if (!gnuTargets.contains(lastUsedGnuTarget))
gnuTargets.prepend(lastUsedGnuTarget);
dlg.setGnuTargets(gnuTargets);
dlg.setRemoteChannel(
configValue(_("LastRemoteChannel")).toString());
dlg.setLocalExecutable(
configValue(_("LastLocalExecutable")).toString());
dlg.setDebugger(configValue(_("LastDebugger")).toString());
dlg.setRemoteArchitecture(lastUsed);
dlg.setGnuTarget(lastUsedGnuTarget);
dlg.setServerStartScript(
configValue(_("LastServerStartScript")).toString());
dlg.setUseServerStartScript(
configValue(_("LastUseServerStartScript")).toBool());
dlg.setSysRoot(configValue(_("LastSysroot")).toString());
if (dlg.exec() != QDialog::Accepted)
return;
setConfigValue(_("LastRemoteChannel"), dlg.remoteChannel());
setConfigValue(_("LastLocalExecutable"), dlg.localExecutable());
setConfigValue(_("LastDebugger"), dlg.debugger());
setConfigValue(_("LastRemoteArchitecture"), dlg.remoteArchitecture());
setConfigValue(_("LastGnuTarget"), dlg.gnuTarget());
setConfigValue(_("LastServerStartScript"), dlg.serverStartScript());
setConfigValue(_("LastUseServerStartScript"), dlg.useServerStartScript());
setConfigValue(_("LastSysroot"), dlg.sysRoot());
sp.remoteChannel = dlg.remoteChannel();
sp.remoteArchitecture = dlg.remoteArchitecture();
sp.gnuTarget = dlg.gnuTarget();
sp.executable = dlg.localExecutable();
sp.displayName = dlg.localExecutable();
sp.debuggerCommand = dlg.debugger(); // Override toolchain-detection.
if (!sp.debuggerCommand.isEmpty())
sp.toolChainType = ToolChain_INVALID;
sp.startMode = AttachToRemote;
sp.useServerStartScript = dlg.useServerStartScript();
sp.serverStartScript = dlg.serverStartScript();
sp.sysRoot = dlg.sysRoot();
if (RunControl *rc = createDebugger(sp))
startDebugger(rc);
}
connect(action(ExecuteCommand), SIGNAL(triggered()),
SLOT(executeDebuggerCommand()));
void DebuggerPluginPrivate::startRemoteEngine()
{
DebuggerStartParameters sp;
StartRemoteEngineDialog dlg(mainWindow());
if (dlg.exec() != QDialog::Accepted)
return;
// Cpp/Qml ui setup
m_uiSwitcher = new DebuggerUISwitcher(m_debugMode, this);
ExtensionSystem::PluginManager::instance()->addObject(m_uiSwitcher);
m_uiSwitcher->addLanguage(CppLanguage, cppDebuggercontext);
m_uiSwitcher->addLanguage(QmlLanguage, qmlDebuggerContext);
m_uiSwitcher->initialize(m_coreSettings);
sp.connParams.host = dlg.host();
sp.connParams.uname = dlg.username();
sp.connParams.pwd = dlg.password();
readSettings();
sp.connParams.timeout = 5;
sp.connParams.authType = SshConnectionParameters::AuthByPwd;
sp.connParams.port = 22;
sp.connParams.proxyType = SshConnectionParameters::NoProxy;
// Dock widgets
m_breakDock = m_uiSwitcher->createDockWidget(CppLanguage, m_breakWindow);
m_breakDock->setObjectName(QString(DOCKWIDGET_BREAK));
sp.executable = dlg.inferiorPath();
sp.serverStartScript = dlg.enginePath();
sp.startMode = StartRemoteEngine;
if (RunControl *rc = createDebugger(sp))
startDebugger(rc);
}
//m_consoleDock = m_uiSwitcher->createDockWidget(CppLanguage, m_consoleWindow,
// Qt::TopDockWidgetArea);
//m_consoleDock->setObjectName(QString(DOCKWIDGET_OUTPUT));
void DebuggerPluginPrivate::enableReverseDebuggingTriggered(const QVariant &value)
{
QTC_ASSERT(m_reverseToolButton, return);
m_reverseToolButton->setVisible(value.toBool());
m_actions.reverseDirectionAction->setChecked(false);
m_actions.reverseDirectionAction->setEnabled(value.toBool());
}
m_modulesDock = m_uiSwitcher->createDockWidget(CppLanguage, m_modulesWindow,
Qt::TopDockWidgetArea);
m_modulesDock->setObjectName(QString(DOCKWIDGET_MODULES));
connect(m_modulesDock->toggleViewAction(), SIGNAL(toggled(bool)),
SLOT(modulesDockToggled(bool)), Qt::QueuedConnection);
void DebuggerPluginPrivate::attachRemoteTcf()
{
DebuggerStartParameters sp;
AttachTcfDialog dlg(mainWindow());
QStringList arches;
arches.append(_("i386:x86-64:intel"));
dlg.setRemoteArchitectures(arches);
dlg.setRemoteChannel(
configValue(_("LastTcfRemoteChannel")).toString());
dlg.setRemoteArchitecture(
configValue(_("LastTcfRemoteArchitecture")).toString());
dlg.setServerStartScript(
configValue(_("LastTcfServerStartScript")).toString());
dlg.setUseServerStartScript(
configValue(_("LastTcfUseServerStartScript")).toBool());
if (dlg.exec() != QDialog::Accepted)
return;
setConfigValue(_("LastTcfRemoteChannel"), dlg.remoteChannel());
setConfigValue(_("LastTcfRemoteArchitecture"), dlg.remoteArchitecture());
setConfigValue(_("LastTcfServerStartScript"), dlg.serverStartScript());
setConfigValue(_("LastTcfUseServerStartScript"), dlg.useServerStartScript());
sp.remoteChannel = dlg.remoteChannel();
sp.remoteArchitecture = dlg.remoteArchitecture();
sp.serverStartScript = dlg.serverStartScript();
sp.startMode = AttachTcf;
if (dlg.useServerStartScript())
sp.serverStartScript = dlg.serverStartScript();
if (RunControl *rc = createDebugger(sp))
startDebugger(rc);
}
m_registerDock = m_uiSwitcher->createDockWidget(CppLanguage, m_registerWindow,
Qt::TopDockWidgetArea);
m_registerDock->setObjectName(QString(DOCKWIDGET_REGISTER));
connect(m_registerDock->toggleViewAction(), SIGNAL(toggled(bool)),
SLOT(registerDockToggled(bool)), Qt::QueuedConnection);
bool DebuggerPluginPrivate::attachCmdLine()
{
if (m_attachRemoteParameters.attachPid) {
showStatusMessage(tr("Attaching to PID %1.")
.arg(m_attachRemoteParameters.attachPid));
const QString crashParameter = m_attachRemoteParameters.winCrashEvent
? QString::number(m_attachRemoteParameters.winCrashEvent) : QString();
attachExternalApplication(m_attachRemoteParameters.attachPid,
QString(), crashParameter);
return true;
}
const QString target = m_attachRemoteParameters.attachTarget;
if (target.isEmpty())
return false;
if (target.indexOf(':') > 0) {
showStatusMessage(tr("Attaching to remote server %1.").arg(target));
attachRemote(target);
} else {
showStatusMessage(tr("Attaching to core %1.").arg(target));
attachCore(target, QString());
}
return true;
}
m_outputDock = m_uiSwitcher->createDockWidget(AnyLanguage, m_logWindow,
Qt::TopDockWidgetArea);
m_outputDock->setObjectName(QString(DOCKWIDGET_OUTPUT));
void DebuggerPluginPrivate::editorOpened(Core::IEditor *editor)
{
if (!isDebuggable(editor))
return;
ITextEditor *textEditor = qobject_cast<ITextEditor *>(editor);
if (!textEditor)
return;
connect(textEditor,
SIGNAL(markRequested(TextEditor::ITextEditor*,int)),
SLOT(requestMark(TextEditor::ITextEditor*,int)));
connect(editor,
SIGNAL(tooltipRequested(TextEditor::ITextEditor*,QPoint,int)),
SLOT(showToolTip(TextEditor::ITextEditor*,QPoint,int)));
connect(textEditor,
SIGNAL(markContextMenuRequested(TextEditor::ITextEditor*,int,QMenu*)),
SLOT(requestContextMenu(TextEditor::ITextEditor*,int,QMenu*)));
}
m_snapshotDock = m_uiSwitcher->createDockWidget(CppLanguage, m_snapshotWindow);
m_snapshotDock->setObjectName(QString(DOCKWIDGET_SNAPSHOTS));
void DebuggerPluginPrivate::editorAboutToClose(Core::IEditor *editor)
{
if (!isDebuggable(editor))
return;
ITextEditor *textEditor = qobject_cast<ITextEditor *>(editor);
if (!textEditor)
return;
disconnect(textEditor,
SIGNAL(markRequested(TextEditor::ITextEditor*,int)),
this, SLOT(requestMark(TextEditor::ITextEditor*,int)));
disconnect(editor,
SIGNAL(tooltipRequested(TextEditor::ITextEditor*,QPoint,int)),
this, SLOT(showToolTip(TextEditor::ITextEditor*,QPoint,int)));
disconnect(textEditor,
SIGNAL(markContextMenuRequested(TextEditor::ITextEditor*,int,QMenu*)),
this, SLOT(requestContextMenu(TextEditor::ITextEditor*,int,QMenu*)));
}
m_stackDock = m_uiSwitcher->createDockWidget(CppLanguage, m_stackWindow);
m_stackDock->setObjectName(QString(DOCKWIDGET_STACK));