troizet opened a new pull request, #6891: URL: https://github.com/apache/netbeans/pull/6891
Now the logic of determining the current breakpoint is based on the information received from xdebug's response to the `get_stack` command, which is not always used to correctly determine the current breakpoint. Since version 3.1.0 Xdebug provides possibility to get information about current breakpoint. To do this you need to enable `breakpoint_details` feature. https://bugs.xdebug.org/bug_view_page.php?bug_id=00001969 In this PR I implemented the use of this feature, with fallback to the old logic, in case xdebug does not support this feature. Examples before and after (using xdebug version 3.1.6): 1) - Write code: ```php <?php echo 'Hi!'; function x() { echo 'Hello'; return 12; } $x = x(); ``` - Set two `method breakpoints` on the `x()` function: one with `stop on call`, the other with `stop on return` behavior before: https://github.com/apache/netbeans/assets/9607501/32cf74f3-9471-4ee9-af61-c8fd5114569d behavior after: https://github.com/apache/netbeans/assets/9607501/eeca1c63-b843-457a-a44b-350650c6a960 2) - Write code: ```php <?php echo 'Hi!'; class MethodBreakpoint { public function x() { echo 'Hello'; return 12; } } $cls = new MethodBreakpoint(); $x = $cls->x(); ``` - Set two `method breakpoints` on the `x()` method: one with `stop on call`, the other with `stop on return` behavior before: https://github.com/apache/netbeans/assets/9607501/b67193a3-ff7d-4640-bc1e-f3a0bce9a2d0 behavior after: https://github.com/apache/netbeans/assets/9607501/80a9f1cf-76b2-469d-9380-c22bb849abc8 3) - Write code: ```php <?php echo 'Hi!'; $foo = $bar['foo']; ``` - Set `exception breakpoint` on `Notice` behavior before: https://github.com/apache/netbeans/assets/9607501/b61db462-1b7a-4508-96f1-088f5c0881f0 behavior after: https://github.com/apache/netbeans/assets/9607501/ddccd736-8a0b-46fa-81ba-c12d98aa2559 4) - Write code: ```php <?php echo 'Hi'; $s = 12; echo 'Hello'; ``` - Put two breakpoints on the line `echo 'Hello';` with different conditions (the order in which the breakpoints are set is important!): - first `$s == 4` - then `$s == 12` behavior before: https://github.com/apache/netbeans/assets/9607501/539bb786-e87b-4b82-9fba-62fb59d01bff behavior after: https://github.com/apache/netbeans/assets/9607501/4332706f-4b31-439e-aceb-f478dc7e94c7 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
