Debugger: Avoid crash when settings change after debugging

If the debugger engine is not running there is anyway no need
to update its data.

Change-Id: I8cda9218985db8b88d96046254847e8916ca37eb
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Stenger
2020-02-12 09:59:57 +01:00
parent 3c0b89f697
commit 94ee0a575d
2 changed files with 8 additions and 0 deletions

View File

@@ -2138,6 +2138,10 @@ void DebuggerEngine::createSnapshot()
void DebuggerEngine::updateLocals() void DebuggerEngine::updateLocals()
{ {
// if the engine is not running - do nothing
if (state() == DebuggerState::DebuggerFinished || state() == DebuggerState::DebuggerNotReady)
return;
watchHandler()->resetValueCache(); watchHandler()->resetValueCache();
doUpdateLocals(UpdateParameters()); doUpdateLocals(UpdateParameters());
} }

View File

@@ -3302,6 +3302,10 @@ void GdbEngine::handlePeripheralRegisterListValues(
void GdbEngine::reloadLocals() void GdbEngine::reloadLocals()
{ {
// if the engine is not running - do nothing
if (state() == DebuggerState::DebuggerFinished || state() == DebuggerState::DebuggerNotReady)
return;
setTokenBarrier(); setTokenBarrier();
updateLocals(); updateLocals();
} }