-
-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debugging is pausing on breakpoints that I didn't add #629
Comments
Hi @daveromsey ! Thank you so much for a great bug report. It's clean and to the point. The described behavior, as I suspected, comes from Xdebugs We can see here the plugin creates a breakpoint, on line 12:
Later, when PHP execution reaches the xdebug-test.php file Xdebug resolves the breakpoint - this means that the PHP file was compiled into op-codes and Xdebug has placed internal hooks to stop execution there. It informs the plugin with this message. Note that the line number is now 8.
This is expected behavior if you'd place a breakpoint on a line with no executable code. However here it's a bit strange. Next, PHP execution stops on line 8:
As you said, a continue request is made and that leads to the next stop event on line 12:
Now here is the strange part. The same breakpoint (see internal ID 49280006) is once again resolved to line 12:
And then as expected a break event happens:
For completeness from Xdebug init: 7.4.0-dev / 2.9.0. @derickr I know this is an unsupported Xdebug version, but was there any bugfix related to this sort of behaviour? I'll try to reproduce the issue with different version here. |
I can't seem to reproduce the issue right now. I'll try later but if it causes real issues you can try to add the following to your
This will turn this feature off. Now there could be other side effects, I have not extensively tested such mode of operation. Best, |
Thank you very much, @zobo! I can confirm that |
I've seen a similar behavior with a little different experience. |
I've managed to reproduce this with PHP 7.1 and xdebug 2.8.1. Log attached. |
Fantastic, will look at it asap. Is it the source from the initial post? |
No, this is a simple two-files setup.
xx-1.php
with breakpoint on "print". |
A related question, though. |
Hi. That said, I took your refence versions and tried out combinations to get as high as possible. I could isolate the error on PHP 7.3(.3) between Xdebug 2.9.0 and 2.9.1. I then went to look at the Xdebug releases xdebug/xdebug@2.9.0...2.9.1 and found the original bug: https://bugs.xdebug.org/view.php?id=1727 I also tried to reproduce the issue on PHP 7.4 but as the mantis issue describes could not. As you said, it's not an issue of this extension but of Xdebug, and has been fixed quite a while back (start of 2020). Regarding your other question of Do you feel there is a chance these features could be missing for any future version of Xdebug, or why do you feel we should continue checking for them? If you have a valid reason I can reinstate them, or we can ask Derick about what he thinks. Best, |
My feelings more in line of being future-proof and having less maintenance overhead. |
I've been running into a problem where PHP Debug sets an "invisible" breakpoint, which I have to Continue over in order to get to my actual breakpoint. I noticed this after updating VS Code. The issue does not happen with my older VS Code setup.
Note: I previously noted this issue in another ticket, but created this new issue to keep things tidy.
Expected breakpoint:
Unexpected Breakpoint once page is loaded:
Note there are also multiple Requests, which I think might be caused by the WP Heartbeat API, which is a separate issue that is being discussed in the original thread linked above.
Environment:
PHP: 7.4.1
Xdebug: v2.9.0 (I'm using Local by Flywheel v5.10.4)
OS: Windows 10 Pro
Old Setup (works, but it's old :) )
VS Code: v1.44.2
PHP Debug (Felix Becker): v1.14.0
New Setup (Has issues, documented below):
VS Code: v1.59.0-insider
PHP Debug (Felix Becker): v1.17.0
XDebug info from
php.ini
I'm using the XDebug Helper Chrome extension to toggle debugging on/off from my browser.
launch.json
WordPress test plugin:
xdebug-test.php
.I added a breakpoint to line 12.
When testing, I've activated the plugin and I'm visiting the
domain.com/wp-admin/plugins.php
page. (Any admin page will trigger theadmin_init
hook).Debug console output (too large to post or pastebin):
phpdebug-console-output.txt
When launching a session, execution will first stop on the line with
add_action( 'admin_init', __NAMESPACE__ . '\xdebug_test' );
which is unexpected since I did not add a breakpoint there. I clickContinue
, then the debugger pauses execution on the line witherror_log( '$i ' . var_export( $i, true ) );
which is where I actually added the breakpoint.The text was updated successfully, but these errors were encountered: