- fix #267: When debugging, can't watch expressions that has spaces in it.

This commit is contained in:
Roy Qu 2024-03-12 20:28:38 +08:00
parent 2cc00cb924
commit 12299e98e9
2 changed files with 2 additions and 2 deletions

View File

@ -1710,7 +1710,7 @@ PWatchVar WatchModel::findWatchVar(const QModelIndex &index)
PWatchVar WatchModel::findWatchVar(const QString &expr) PWatchVar WatchModel::findWatchVar(const QString &expr)
{ {
foreach (const PWatchVar &var, watchVars(mIsForProject)) { foreach (const PWatchVar &var, watchVars(mIsForProject)) {
if (expr == var->expression) { if (expr == QString("\"%1\"").arg(var->expression)) {
return var; return var;
} }
} }

View File

@ -1128,7 +1128,7 @@ void GDBMIDebuggerClient::setBreakpointCondition(PBreakpoint breakpoint)
void GDBMIDebuggerClient::addWatch(const QString &expression) void GDBMIDebuggerClient::addWatch(const QString &expression)
{ {
postCommand("-var-create", expression); postCommand("-var-create", QString("\"%1\"").arg(expression));
} }
void GDBMIDebuggerClient::removeWatch(PWatchVar watchVar) void GDBMIDebuggerClient::removeWatch(PWatchVar watchVar)