diff --git a/RedPandaIDE/debugger/debugger.cpp b/RedPandaIDE/debugger/debugger.cpp index 166dc43d..287e8b23 100644 --- a/RedPandaIDE/debugger/debugger.cpp +++ b/RedPandaIDE/debugger/debugger.cpp @@ -1710,7 +1710,7 @@ PWatchVar WatchModel::findWatchVar(const QModelIndex &index) PWatchVar WatchModel::findWatchVar(const QString &expr) { foreach (const PWatchVar &var, watchVars(mIsForProject)) { - if (expr == var->expression) { + if (expr == QString("\"%1\"").arg(var->expression)) { return var; } } diff --git a/RedPandaIDE/debugger/gdbmidebugger.cpp b/RedPandaIDE/debugger/gdbmidebugger.cpp index 3d68e21d..944d3272 100644 --- a/RedPandaIDE/debugger/gdbmidebugger.cpp +++ b/RedPandaIDE/debugger/gdbmidebugger.cpp @@ -1128,7 +1128,7 @@ void GDBMIDebuggerClient::setBreakpointCondition(PBreakpoint breakpoint) void GDBMIDebuggerClient::addWatch(const QString &expression) { - postCommand("-var-create", expression); + postCommand("-var-create", QString("\"%1\"").arg(expression)); } void GDBMIDebuggerClient::removeWatch(PWatchVar watchVar)