Skip to content
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

Debugger hits removed breakpoints on Windows #44

Closed
JoelOnGithub opened this issue Jun 19, 2016 · 12 comments
Closed

Debugger hits removed breakpoints on Windows #44

JoelOnGithub opened this issue Jun 19, 2016 · 12 comments
Labels

Comments

@JoelOnGithub
Copy link

JoelOnGithub commented Jun 19, 2016

Issue: When I hit the first breakpoint on line 4, then remove the breakpoint on line 4 and click continue, I will still keep hitting what used to be the breakpoint on line 4.

When I do exactly the same thing with XDebug in Atom, this doesn't happen.

PHP version: 5.6.16
XDebug version: php_xdebug-2.4.0-5.6-vc11-x86_64.dll
Adapter version:

Your launch.json: link

XDebug php.ini config: link

XDebug logfile (from setting xdebug.remote_log in php.ini): link

Adapter logfile (from setting "log": true in launch.json): Sorry for the weird indents

Code snippet to reproduce:

<?php

for( $i = 0; $i < 2; $i++ ){
    echo $i;
}

phpinfo();

?>
@felixfbecker
Copy link
Contributor

@JoelOnGithub I know it is hard to copy from the debug console, but I need to inspect the setBreakpointRequests... could you please copy it? You have to do it one page at a time

@JoelOnGithub
Copy link
Author

Haha oh man! Updated :)

@felixfbecker
Copy link
Contributor

Try this one please
php-debug-1.9.1.vsix.zip

@JoelOnGithub
Copy link
Author

I see no difference in behavior

@felixfbecker
Copy link
Contributor

Could you get the logs again with that version?

@JoelOnGithub
Copy link
Author

@felixfbecker felixfbecker changed the title Debugger hits removed breakpoints Debugger hits removed breakpoints on Windows Jun 22, 2016
@felixfbecker
Copy link
Contributor

Please see if 1.9.2 fixes your problem

@JoelOnGithub
Copy link
Author

Yes it has been fixed! Thank you very much. You can close the ticket.

Just out of curiosity, can you tell me what was going wrong?

@felixfbecker
Copy link
Contributor

felixfbecker commented Jun 22, 2016

Well, to update the breakpoints, I get them all, then remove them all for the file in question, and then re-set them. First of all, when parsing the XDebug response, I forgot to set the fileUri property on the LineBreakpoint object, so it was always undefined and never matched. Secondly, VS Code sends a file path like c:\hello_world on Windows (lowercase drive letter), while XDebug always sends file:///C:/hello_world (uppercase drive letter) so I had to compare them case-insensitive on Windows. You can look at 34be582 and 3d84341 if you are interested. I also added a test for this in f71fa26, but for some reason it fails in CI (it passes on my machine).

@JoelOnGithub
Copy link
Author

Thanks for the explanation!

@bilogic
Copy link

bilogic commented Nov 3, 2019

Hi,

This is happening for me now in VSCode 1.37.1
PHP Debug Adapter: 1.13.0
PHP 7.2.10 (cli) (built: Sep 11 2018 09:59:29) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.10, Copyright (c) 1999-2018, by Zend Technologies
with Xdebug v2.6.1, Copyright (c) 2002-2018, by Derick Rethans

@bilogic
Copy link

bilogic commented Nov 4, 2019

This is from my debug console, from what I gather, there are no more breakpoints, yet it breaks again if I Continue (F5)

-> setBreakpointsRequest
{ command: 'setBreakpoints',
  arguments:
   { source:
      { name: 'layout_controller.php',
        path:
         'e:\\project\\layout_controller.php' },
     lines: [],
     breakpoints: [],
     sourceModified: false },
  type: 'request',
  seq: 22 }

<- setBreakpointsResponse
Response {
  seq: 0,
  type: 'response',
  request_seq: 22,
  command: 'setBreakpoints',
  success: true,
  body: { breakpoints: [] } }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants