You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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?
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...)
Activity
zobo commentedon 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 commentedon Jun 12, 2023
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 commentedon 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 commentedon Jun 23, 2023
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 commentedon Jul 1, 2023
microsoft/vscode#185985 (comment)
zobo commentedon 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.