From e0b2994847e8a1340a19013edfb5667086409d6c Mon Sep 17 00:00:00 2001 From: Ernie Pasveer Date: Sat, 25 Nov 2023 10:39:38 -0600 Subject: [PATCH] Fixed breakpoint conditions to handle string comparisons. --- src/SeerBreakpointCreateDialog.cpp | 5 +- src/SeerBreakpointCreateDialog.ui | 74 ++++++++++-------------------- src/SeerGdbWidget.cpp | 4 +- 3 files changed, 31 insertions(+), 52 deletions(-) diff --git a/src/SeerBreakpointCreateDialog.cpp b/src/SeerBreakpointCreateDialog.cpp index d8827aad..abc7f8fc 100644 --- a/src/SeerBreakpointCreateDialog.cpp +++ b/src/SeerBreakpointCreateDialog.cpp @@ -180,7 +180,10 @@ QString SeerBreakpointCreateDialog::breakpointText () const { if (conditionalEnabled()) { if (conditionalText() != "") { - breakpointParameters += " -c \"" + conditionalText() + "\""; + + QString str = conditionalText().replace('"', "\\\""); // Quote " characters. + + breakpointParameters += " -c \"" + str + "\""; } } diff --git a/src/SeerBreakpointCreateDialog.ui b/src/SeerBreakpointCreateDialog.ui index bf848933..92ad4a7f 100644 --- a/src/SeerBreakpointCreateDialog.ui +++ b/src/SeerBreakpointCreateDialog.ui @@ -146,26 +146,13 @@ - - - Qt::Horizontal - - - - 40 - 20 - - - - - Condition if: - + true @@ -180,86 +167,73 @@ - - - Qt::Horizontal - - - - 40 - 20 - - - - - Ignore Count - + true - - - - Pending - - - - - + + Qt::Horizontal - 40 + 131 20 - + + + + Pending + + + + Thread Id - + true - - - - Disabled - - - - - + + Qt::Horizontal - 40 + 131 20 + + + + Disabled + + + diff --git a/src/SeerGdbWidget.cpp b/src/SeerGdbWidget.cpp index 751a1863..62468c0c 100644 --- a/src/SeerGdbWidget.cpp +++ b/src/SeerGdbWidget.cpp @@ -1983,7 +1983,9 @@ void SeerGdbWidget::handleGdbBreakpointCondition (QString breakpoint, QString co return; } - handleGdbCommand("-break-condition " + breakpoint + " " + condition); + QString str = condition.replace('"', "\\\""); // Quote " characters. + + handleGdbCommand("-break-condition " + breakpoint + " \"" + condition + "\""); handleGdbGenericpointList(); }