diff --git a/src/plugins/debugger/debuggerconstants.h b/src/plugins/debugger/debuggerconstants.h index e17cfa77338f28fdad518e2ef40ad84a37f2c0e9..839dc62d7d04f5fc265b07de2ac4da3925ed6843 100644 --- a/src/plugins/debugger/debuggerconstants.h +++ b/src/plugins/debugger/debuggerconstants.h @@ -181,6 +181,7 @@ enum ModelRoles RequestLoadSessionDataRole, RequestSaveSessionDataRole, RequestOperatedByInstructionTriggeredRole, + RequestExecuteCommandRole, // Breakpoints BreakpointEnabledRole, diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 16226caf5fd064e55ec6e207acc32327c16d469c..1f95d73c152a17aa7255998578fcf74850cd3fe9 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -173,12 +173,9 @@ private: DebuggerEngine *m_engine; }; -bool CommandHandler::setData - (const QModelIndex &index, const QVariant &value, int role) +bool CommandHandler::setData(const QModelIndex &, const QVariant &value, int role) { //qDebug() << "COMMAND: " << role << value; - Q_UNUSED(index); - Q_UNUSED(value); switch (role) { case RequestLoadSessionDataRole: @@ -265,6 +262,9 @@ bool CommandHandler::setData m_engine->gotoLocation(m_engine->stackHandler()->currentFrame(), true); return true; + case RequestExecuteCommandRole: + m_engine->executeDebuggerCommand(value.toString()); + return true; } return false; diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 97d882016cf9d20c8ee18127df270638e1a2f99a..5ac3aaf89b37619fca8603253575b6ce295b1178 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -852,8 +852,8 @@ public slots: void aboutToUnloadSession(); void aboutToSaveSession(); void watchPoint() { QTC_ASSERT(false, /**/); } // FIXME - void executeDebuggerCommand() { QTC_ASSERT(false, /**/); } // FIXME - void executeDebuggerCommand(QString const &) {} + + void executeDebuggerCommand(); public: DebuggerState m_state; @@ -2311,6 +2311,12 @@ void DebuggerPluginPrivate::exitDebugger() m_codeModelSnapshot = CPlusPlus::Snapshot(); } +void DebuggerPluginPrivate::executeDebuggerCommand() +{ + if (QAction *action = qobject_cast<QAction *>(sender())) + notifyCurrentEngine(RequestExecuteCommandRole, action->data().toString()); +} + /////////////////////////////////////////////////////////////////////// //