Skip to content

Commit

Permalink
Properly escape the command arguments for the WatchView
Browse files Browse the repository at this point in the history
Closes #3320
  • Loading branch information
mrexodia committed Mar 7, 2024
1 parent 5a08d29 commit 34b1d96
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/gui/Src/Gui/WatchView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ void WatchView::addWatchSlot()
{
QString name;
if(SimpleInputBox(this, tr("Enter the expression to watch"), "", name, tr("Example: [EAX]")))
DbgCmdExecDirect(QString("AddWatch ").append(name));
DbgCmdExecDirect(QString("AddWatch \"%1\"").arg(DbgCmdEscape(name)));
updateWatch();
}

Expand All @@ -223,7 +223,7 @@ void WatchView::renameWatchSlot()
QString name;
QString originalName = getCellContent(getInitialSelection(), ColName);
if(SimpleInputBox(this, tr("Enter the name of the watch variable"), originalName, name, originalName))
DbgCmdExecDirect(QString("SetWatchName ").append(getSelectedId() + "," + name));
DbgCmdExecDirect(QString("SetWatchName %1, \"%2\"").arg(getSelectedId(), DbgCmdEscape(name)));
updateWatch();
}

Expand All @@ -250,7 +250,7 @@ void WatchView::editWatchSlot()
QString originalExpr = getCellContent(getInitialSelection(), ColExpr);
QString currentType = getCellContent(getInitialSelection(), ColType);
if(SimpleInputBox(this, tr("Enter the expression to watch"), originalExpr, expr, tr("Example: [EAX]")))
DbgCmdExecDirect(QString("SetWatchExpression ").append(getSelectedId()).append(",").append(expr).append(",").append(currentType));
DbgCmdExecDirect(QString("SetWatchExpression %1, \"%2\", %3").arg(getSelectedId(), DbgCmdEscape(expr), currentType));
updateWatch();
}

Expand Down

1 comment on commit 34b1d96

@utkonos
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrexodia Was breakpoint-file-logging branch where this is meant to be committed?

Please sign in to comment.