aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/debugger/debuggerplugin.cpp
diff options
context:
space:
mode:
authorTim Sander <[email protected]>2014-06-05 17:22:51 +0200
committerhjk <[email protected]>2014-06-20 10:57:03 +0200
commit3828c94b3938ddc60cc431e719a75ec0c8fdbaf7 (patch)
tree6c146e8d13b3efb3f3140e42594541cd68381978 /src/plugins/debugger/debuggerplugin.cpp
parent5df2389970d574b26380f0aab3de8909ed2f1c7e (diff)
GdbDebugger: add fast restart for debugging
Change-Id: Ie51847de912748d05a6b208bec82fd612d777202 Reviewed-by: hjk <[email protected]> Reviewed-by: Leena Miettinen <[email protected]>
Diffstat (limited to 'src/plugins/debugger/debuggerplugin.cpp')
-rw-r--r--src/plugins/debugger/debuggerplugin.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index 89b2de50aeb..303a1af21ee 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -1004,6 +1004,12 @@ public slots:
currentEngine()->abortDebugger();
}
+ void handleReset()
+ {
+ currentEngine()->resetLocation();
+ currentEngine()->resetInferior();
+ }
+
void handleExecStep()
{
if (currentEngine()->state() == DebuggerNotReady) {
@@ -1250,6 +1256,7 @@ public:
QAction *m_reverseDirectionAction;
QAction *m_frameUpAction;
QAction *m_frameDownAction;
+ QAction *m_resetAction;
QToolButton *m_reverseToolButton;
@@ -1258,6 +1265,7 @@ public:
QIcon m_continueIcon;
QIcon m_interruptIcon;
QIcon m_locationMarkIcon;
+ QIcon m_resetIcon;
StatusLabel *m_statusLabel;
QComboBox *m_threadBox;
@@ -2247,6 +2255,7 @@ void DebuggerPluginPrivate::setInitialState()
m_exitAction->setEnabled(false);
m_abortAction->setEnabled(false);
+ m_resetAction->setEnabled(false);
m_interruptAction->setEnabled(false);
m_continueAction->setEnabled(false);
@@ -2386,6 +2395,8 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
m_abortAction->setEnabled(state != DebuggerNotReady
&& state != DebuggerFinished);
+ m_resetAction->setEnabled((stopped || state == DebuggerNotReady)
+ && engine->hasCapability(ResetInferiorCapability));
m_stepAction->setEnabled(stopped || state == DebuggerNotReady);
m_nextAction->setEnabled(stopped || state == DebuggerNotReady);
@@ -2775,6 +2786,8 @@ void DebuggerPluginPrivate::extensionsInitialized()
m_interruptIcon = QIcon(_(Core::Constants::ICON_PAUSE));
m_interruptIcon.addFile(QLatin1String(":/debugger/images/debugger_interrupt.png"));
m_locationMarkIcon = QIcon(_(":/debugger/images/location_16.png"));
+ m_resetIcon = QIcon(_(":/debugger/images/debugger_restart_small.png:"));
+ m_resetIcon.addFile(QLatin1String(":/debugger/images/debugger_restart.png"));
m_busy = false;
@@ -2849,6 +2862,11 @@ void DebuggerPluginPrivate::extensionsInitialized()
"resets the debugger to the initial state."));
connect(act, SIGNAL(triggered()), SLOT(handleAbort()));
+ act = m_resetAction = new QAction(tr("Restart Debugging"),this);
+ act->setToolTip(tr("Restart the debugging session."));
+ act->setIcon(m_resetIcon);
+ connect(act,SIGNAL(triggered()),SLOT(handleReset()));
+
act = m_nextAction = new QAction(tr("Step Over"), this);
act->setIcon(QIcon(QLatin1String(":/debugger/images/debugger_stepover_small.png")));
connect(act, SIGNAL(triggered()), SLOT(handleExecNext()));
@@ -3098,6 +3116,12 @@ void DebuggerPluginPrivate::extensionsInitialized()
cmd->setDescription(tr("Reset Debugger"));
debugMenu->addAction(cmd, CC::G_DEFAULT_ONE);
+ cmd = ActionManager::registerAction(m_resetAction,
+ Constants::RESET, globalcontext);
+ cmd->setDescription(tr("Restart Debugging"));
+ cmd->setDefaultKeySequence(QKeySequence(tr("Shift+Ctrl+R")));
+ debugMenu->addAction(cmd, CC::G_DEFAULT_ONE);
+
debugMenu->addSeparator(globalcontext);
cmd = ActionManager::registerAction(m_nextAction,
@@ -3310,6 +3334,7 @@ void DebuggerPluginPrivate::extensionsInitialized()
hbox->addWidget(toolButton(Constants::NEXT));
hbox->addWidget(toolButton(Constants::STEP));
hbox->addWidget(toolButton(Constants::STEPOUT));
+ hbox->addWidget(toolButton(Constants::RESET));
hbox->addWidget(toolButton(Constants::OPERATE_BY_INSTRUCTION));
//hbox->addWidget(new StyledSeparator);