summaryrefslogtreecommitdiff
path: root/src/plugins/debugger/debuggermanager.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2009-10-07 13:36:48 +0200
committercon <qtc-committer@nokia.com>2009-10-07 14:12:35 +0200
commit6bac5dac4bc1edb22d1ec56ce696a54008e879f2 (patch)
tree4c3bef45e66001af688bd97e571f2fbd2f32de04 /src/plugins/debugger/debuggermanager.cpp
parent32c5c7ce6e7c5187d893d56d9f6e4970ea764d14 (diff)
downloadqt-creator-6bac5dac4bc1edb22d1ec56ce696a54008e879f2.tar.gz
Debugger: Fix crash toggling Stack/"Derefence Pointers" without project
Enable debugger actions correctly. Reviewed-by: hjk <qtc-committer@nokia.com> (cherry picked from commit 1fb8f60e03a267941822eb96ab8e6faedc6036f1)
Diffstat (limited to 'src/plugins/debugger/debuggermanager.cpp')
-rw-r--r--src/plugins/debugger/debuggermanager.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/plugins/debugger/debuggermanager.cpp b/src/plugins/debugger/debuggermanager.cpp
index a90d143f9d..7d96912c8a 100644
--- a/src/plugins/debugger/debuggermanager.cpp
+++ b/src/plugins/debugger/debuggermanager.cpp
@@ -1684,11 +1684,51 @@ void DebuggerManager::setState(DebuggerState state)
d->m_actions.runToFunctionAction->setEnabled(stopped);
d->m_actions.jumpToLineAction->setEnabled(stopped);
d->m_actions.nextAction->setEnabled(stopped);
+
+ const bool actionsEnabled = debuggerActionsEnabled();
+ theDebuggerAction(RecheckDebuggingHelpers)->setEnabled(actionsEnabled);
+ theDebuggerAction(AutoDerefPointers)->setEnabled(actionsEnabled && d->m_engine->isGdbEngine());
+ theDebuggerAction(ExpandStack)->setEnabled(actionsEnabled);
+ theDebuggerAction(ExecuteCommand)->setEnabled(d->m_state != DebuggerNotReady);
+
emit stateChanged(d->m_state);
const bool notbusy = state == InferiorStopped
|| state == DebuggerNotReady
|| state == InferiorUnrunnable;
setBusyCursor(!notbusy);
+
+}
+
+bool DebuggerManager::debuggerActionsEnabled() const
+{
+ if (!d->m_engine)
+ return false;
+ switch (state()) {
+ case InferiorPrepared:
+ case InferiorStarting:
+ case InferiorRunningRequested:
+ case InferiorRunning:
+ case InferiorUnrunnable:
+ case InferiorStopping:
+ case InferiorStopped:
+ return true;
+ case DebuggerNotReady:
+ case EngineStarting:
+ case AdapterStarting:
+ case AdapterStarted:
+ case AdapterStartFailed:
+ case InferiorPreparing:
+ case InferiorPreparationFailed:
+ case InferiorStartFailed:
+ case InferiorStopFailed:
+ case InferiorShuttingDown:
+ case InferiorShutDown:
+ case InferiorShutdownFailed:
+ case AdapterShuttingDown:
+ case AdapterShutdownFailed:
+ break;
+ }
+ return false;
}
QDebug operator<<(QDebug d, DebuggerState state)