Debugger: evaluate expression before assigning when using python dumper

Fixes: QTCREATORBUG-23711
Change-Id: Ic386b3e4bdd948e74f52116248de1b33a35fe03a
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
David Schulz
2020-04-23 10:00:23 +02:00
parent f057adcff2
commit f71286db98
2 changed files with 69 additions and 42 deletions

View File

@@ -929,8 +929,15 @@ void CdbEngine::assignValueInDebugger(WatchItem *w, const QString &expr, const Q
qWarning("Internal error: assignValueInDebugger: Invalid state or no stack frame.");
return;
}
runCommand({m_extensionCommandPrefix + "assign -h " + w->iname + '=' + toHex(value.toString()),
NoFlags});
if (m_pythonVersion > 0x030000 && w->isWatcher()) {
runCommand({m_extensionCommandPrefix + "assign -h -e " + toHex(w->expression()) + '='
+ toHex(value.toString()),
NoFlags});
} else {
runCommand({m_extensionCommandPrefix + "assign -h " + w->iname + '=' + toHex(value.toString()),
NoFlags});
}
// Update all locals in case we change a union or something pointed to
// that affects other variables, too.
updateLocals();