From f1cd284a332a9ba9184362d010a4fd10b00f1776 Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 22 Jun 2010 12:02:24 +0200 Subject: [PATCH] debugger: connect some loose ends --- src/plugins/debugger/debuggerconstants.h | 1 + src/plugins/debugger/debuggerengine.cpp | 11 ++++----- src/plugins/debugger/debuggerengine.h | 1 - src/plugins/debugger/debuggerplugin.cpp | 30 +++++++++++------------- 4 files changed, 20 insertions(+), 23 deletions(-) diff --git a/src/plugins/debugger/debuggerconstants.h b/src/plugins/debugger/debuggerconstants.h index ca15e371505..e17cfa77338 100644 --- a/src/plugins/debugger/debuggerconstants.h +++ b/src/plugins/debugger/debuggerconstants.h @@ -180,6 +180,7 @@ enum ModelRoles RequestExecExitRole, RequestLoadSessionDataRole, RequestSaveSessionDataRole, + RequestOperatedByInstructionTriggeredRole, // Breakpoints BreakpointEnabledRole, diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 5c994407d33..16226caf5fd 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -260,6 +260,11 @@ bool CommandHandler::setData case RequestExecFrameUpRole: m_engine->frameUp(); return true; + + case RequestOperatedByInstructionTriggeredRole: + m_engine->gotoLocation(m_engine->stackHandler()->currentFrame(), true); + return true; + } return false; @@ -673,12 +678,6 @@ void DebuggerManager::executeJumpToLine() } */ -void DebuggerEngine::operateByInstructionTriggered() -{ - StackFrame frame = d->m_stackHandler.currentFrame(); - gotoLocation(frame, true); -} - void DebuggerEngine::cleanup() { /* diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h index b6725632c3c..06671e27d85 100644 --- a/src/plugins/debugger/debuggerengine.h +++ b/src/plugins/debugger/debuggerengine.h @@ -236,7 +236,6 @@ public: void executeReturnX(); void executeWatchPointX(); - void operateByInstructionTriggered(); DebuggerState state() const; // Dumper stuff (common to cdb and gdb). diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 6ed413fc7d3..185192fbf14 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -772,17 +772,12 @@ public slots: void updateWatchersHeader(int section, int, int newSize) { m_watchersWindow->header()->resizeSection(section, newSize); } - void reloadSourceFiles() - { notifyCurrentEngine(RequestReloadSourceFilesRole); } - void sourceFilesDockToggled(bool on) - { if (on) reloadSourceFiles(); } - - void reloadModules() - { notifyCurrentEngine(RequestReloadModulesRole); } - + { if (on) notifyCurrentEngine(RequestReloadSourceFilesRole); } void modulesDockToggled(bool on) - { if (on) reloadModules(); } + { if (on) notifyCurrentEngine(RequestReloadModulesRole); } + void registerDockToggled(bool on) + { if (on) notifyCurrentEngine(RequestReloadRegistersRole); } void onAction(); void setSimpleDockWidgetArrangement(const QString &activeLanguage); @@ -851,9 +846,7 @@ public slots: void resetLocation(); void gotoLocation(const QString &file, int line, bool setMarker); - void registerDockToggled(bool on) {} // FIXME void clearStatusMessage(); - void operateByInstructionTriggered() {} // FIXME void sessionLoaded(); void aboutToUnloadSession(); @@ -1122,6 +1115,9 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er m_actions.frameUpAction->setData(RequestExecFrameUpRole); m_actions.reverseDirectionAction->setCheckable(false); + theDebuggerAction(OperateByInstruction)-> + setData(RequestOperatedByInstructionTriggeredRole); + connect(m_actions.continueAction, SIGNAL(triggered()), SLOT(onAction())); connect(m_actions.nextAction, SIGNAL(triggered()), SLOT(onAction())); connect(m_actions.stepAction, SIGNAL(triggered()), SLOT(onAction())); @@ -1146,7 +1142,7 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er SLOT(executeDebuggerCommand())); connect(theDebuggerAction(OperateByInstruction), SIGNAL(triggered()), - SLOT(operateByInstructionTriggered())); + SLOT(onAction())); m_plugin->readSettings(); @@ -1160,26 +1156,28 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er // Dock widgets m_breakDock = m_uiSwitcher->createDockWidget(LANG_CPP, m_breakWindow); + m_modulesDock = m_uiSwitcher->createDockWidget(LANG_CPP, m_modulesWindow, Qt::TopDockWidgetArea, false); - connect(m_modulesDock->toggleViewAction(), SIGNAL(toggled(bool)), - this, SLOT(reloadModules()), Qt::QueuedConnection); + SLOT(modulesDockToggled(bool)), Qt::QueuedConnection); m_registerDock = m_uiSwitcher->createDockWidget(LANG_CPP, m_registerWindow, Qt::TopDockWidgetArea, false); connect(m_registerDock->toggleViewAction(), SIGNAL(toggled(bool)), - m_registerWindow, SLOT(reloadRegisters()), Qt::QueuedConnection); + SLOT(registerDockToggled(bool)), Qt::QueuedConnection); m_outputDock = m_uiSwitcher->createDockWidget(LANG_CPP, m_outputWindow, Qt::TopDockWidgetArea, false); m_snapshotDock = m_uiSwitcher->createDockWidget(LANG_CPP, m_snapshotWindow); + m_stackDock = m_uiSwitcher->createDockWidget(LANG_CPP, m_stackWindow); + m_sourceFilesDock = m_uiSwitcher->createDockWidget(LANG_CPP, m_sourceFilesWindow, Qt::TopDockWidgetArea, false); connect(m_sourceFilesDock->toggleViewAction(), SIGNAL(toggled(bool)), - this, SLOT(reloadSourceFiles()), Qt::QueuedConnection); + SLOT(sourceFilesDockToggled(bool)), Qt::QueuedConnection); m_threadsDock = m_uiSwitcher->createDockWidget(LANG_CPP, m_threadsWindow);