Skip to content

Commit

Permalink
Merge pull request #187 from epasveer/184-trouble-setting-a-condition…
Browse files Browse the repository at this point in the history
…al-breakpoint

Fixed breakpoint conditions to handle string comparisons.
  • Loading branch information
epasveer authored Nov 25, 2023
2 parents 813acd2 + e0b2994 commit 147b17c
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 52 deletions.
5 changes: 4 additions & 1 deletion src/SeerBreakpointCreateDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ QString SeerBreakpointCreateDialog::breakpointText () const {

if (conditionalEnabled()) {
if (conditionalText() != "") {
breakpointParameters += " -c \"" + conditionalText() + "\"";

QString str = conditionalText().replace('"', "\\\""); // Quote " characters.

breakpointParameters += " -c \"" + str + "\"";
}
}

Expand Down
74 changes: 24 additions & 50 deletions src/SeerBreakpointCreateDialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -146,26 +146,13 @@
</widget>
</item>
<item row="0" column="1">
<spacer name="temporaryHorizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="2">
<widget class="QCheckBox" name="conditionalCheckBox">
<property name="text">
<string>Condition if:</string>
</property>
</widget>
</item>
<item row="0" column="3">
<item row="0" column="2" colspan="2">
<widget class="QLineEdit" name="conditionalLineEdit">
<property name="clearButtonEnabled">
<bool>true</bool>
Expand All @@ -180,86 +167,73 @@
</widget>
</item>
<item row="1" column="1">
<spacer name="hardwareHorizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="2">
<widget class="QCheckBox" name="ignoreCountCheckBox">
<property name="text">
<string>Ignore Count</string>
</property>
</widget>
</item>
<item row="1" column="3">
<item row="1" column="2">
<widget class="QLineEdit" name="ignoreCountLineEdit">
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="pendingCheckBox">
<property name="text">
<string>Pending</string>
</property>
</widget>
</item>
<item row="2" column="1">
<spacer name="pendingHorizontalSpacer">
<item row="1" column="3">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<width>131</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="2">
<item row="2" column="0">
<widget class="QCheckBox" name="pendingCheckBox">
<property name="text">
<string>Pending</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="threadIdCheckBox">
<property name="text">
<string>Thread Id</string>
</property>
</widget>
</item>
<item row="2" column="3">
<item row="2" column="2">
<widget class="QLineEdit" name="threadIdLineEdit">
<property name="clearButtonEnabled">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="disabledCheckBox">
<property name="text">
<string>Disabled</string>
</property>
</widget>
</item>
<item row="3" column="1">
<spacer name="disabledHorizontalSpacer">
<item row="2" column="3">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<width>131</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="disabledCheckBox">
<property name="text">
<string>Disabled</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
Expand Down
4 changes: 3 additions & 1 deletion src/SeerGdbWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit 147b17c

Please sign in to comment.