PHP: mark a breakpoint as broken when an error is received when breakpoint_set is executed to set a breakpoint #6876
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
xdebug of different versions behaves differently when setting duplicate breakpoints.
xdebug version 2.5.5 allows you to set a duplicate breakpoint.
xdebug version 3.1.6 and higher does not allow setting a duplicate breakpoint by method.
Since version 3.2.0 it also does not allow setting a duplicate breakpoint by line.
If an attempt is made to set a duplicate breakpoint, xdebug returns an error:
This PR implements this error handling and marks the breakpoint as broken.
Tested on versions of xdebug:
2.5.5
,3.1.6
,3.2.1
,3.3.0
.Example for a line breakpoint:
Put two breakpoints on the line
echo 'Hello';
with different conditions (the order in which the breakpoints are set is important!):$s == 4
$s == 12
When debugging on xdebug version
2.5.5
or3.1.6
, it will stop at the point with the condition$s == 12
.Everything is fine with this.
When debugging on version
3.2.0
, stopping at a point with the condition$s == 12
will not be executed, because thexdebug will not set the breakpoint. But the breakpoint is shown as normal, which is misleading.
Behavior before PR:
simplescreenrecorder-2023-12-24_00.46.34.mp4
Behavior after PR:
simplescreenrecorder-2023-12-24_00.44.03.mp4