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

feature request: data breakpoints #903

Open
Ernestopheles opened this issue Jun 10, 2023 · 6 comments
Open

feature request: data breakpoints #903

Ernestopheles opened this issue Jun 10, 2023 · 6 comments

Comments

@Ernestopheles
Copy link

I am missing a feature to set data breakpoints, i.e. have debugging stop when a condition comes true, especially a variable changes its value (in generell or to a specific value). As far as I can see this is now only possible at a specific code line but not globally.

@zobo
Copy link
Contributor

zobo commented Jun 12, 2023

Hello. I do not think this is possible with Xdebug. But you could probably implement a setter magic function and set up a conditional breakpoint there.

@Ernestopheles
Copy link
Author

Thanks, but the setter does not help in this case. What reasons are there that hinders xdebug to have data breakpoints? Is it PHP itself, the IDE or the plugin?

@zobo
Copy link
Contributor

zobo commented Jun 23, 2023

First this is not supported in Xdebug. You can open a feature request here https://bugs.xdebug.org/ , but I'm sure this will not be a small task and Derick has little time for extra Xdebug features sadly (sponsors can help...)

Second it seems that the DAP has support for this https://microsoft.github.io/debug-adapter-protocol/specification#Requests_SetDataBreakpoints and https://microsoft.github.io/debug-adapter-protocol/specification#Requests_DataBreakpointInfo .

However I do not think I have seen UI support for this in VS Code. That would also need to be implemented (by Microsoft) https://github.com/microsoft/vscode/issues

I think the only way to get this is to structure your code in such way that you can set a file/line breakpoint or add xdebug_break() code...

@Ernestopheles
Copy link
Author

Thanks for bringing light into this.

Going to open issues at the places you mentioned and trying to work around in the maybe long lasting meanwhile.

@Ernestopheles
Copy link
Author

@zobo
Copy link
Contributor

zobo commented Jul 2, 2023

Hi! Apparently I was wrong here, sorry for letting you run circles. I'm traveling and will try to look at again this as soon as I can.

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

No branches or pull requests

2 participants