Commit ea6ff591 authored by hjk's avatar hjk
Browse files

debugger: switch off reverse debugging tool button if not useful

parent 21065291
......@@ -1113,8 +1113,11 @@ void DebuggerManager::startNewDebugger(const DebuggerStartParametersPtr &sp)
const unsigned engineCapabilities = d->m_engine->debuggerCapabilities();
theDebuggerAction(OperateByInstruction)
->setEnabled(engineCapabilities & DisassemblerCapability);
d->m_actions.reverseDirectionAction
->setEnabled(engineCapabilities & ReverseSteppingCapability);
const bool canReverse = (engineCapabilities & ReverseSteppingCapability)
&& theDebuggerBoolSetting(EnableReverseDebugging);
d->m_actions.reverseDirectionAction->setChecked(false);
d->m_actions.reverseDirectionAction->setEnabled(canReverse);
}
void DebuggerManager::startFailed()
......@@ -1136,6 +1139,7 @@ void DebuggerManager::cleanupViews()
d->m_sourceFilesWindow->removeAll();
d->m_disassemblerViewAgent.cleanup();
d->m_actions.reverseDirectionAction->setChecked(false);
d->m_actions.reverseDirectionAction->setEnabled(false);
// FIXME: Move to plugin?
using namespace Core;
......
......@@ -1506,8 +1506,8 @@ void DebuggerPlugin::enableReverseDebuggingTriggered(const QVariant &value)
{
QTC_ASSERT(m_reverseToolButton, return);
m_reverseToolButton->setVisible(value.toBool());
if (!value.toBool())
m_manager->debuggerManagerActions().reverseDirectionAction->setChecked(false);
m_manager->debuggerManagerActions().reverseDirectionAction->setChecked(false);
m_manager->debuggerManagerActions().reverseDirectionAction->setEnabled(value.toBool());
}
void DebuggerPlugin::toggleBreakpoint()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment