PHP Tools for Visual Studio: Difference between revisions

Content deleted Content added
No edit summary
mNo edit summary
Line 37:
===Debugger===
The majority of features of the integrated [[debugger]] of Visual Studio are supported by PHP Tools. The debugger consists of two main components: the front-end component is the one responsible for visually communicating with the user, and the back-end component is hooked directly to the PHP core. PHP Tools for Visual Studio provides the front-end component and communicates with the back-end provided by the [[Xdebug]] extension. The communication uses the DBGp debugging protocol.
Equally as in Visual Studio<ref>https://docs.microsoft.com/en-us/visualstudio/debugger/debugger-feature-tour?view=vs-2019#set-a-breakpoint-and-start-the-debugger</ref>, the debugger allows setting [[breakpoints]] to stop execution at a certain position in the code and watches which monitor values of variables when the program is paused. Breakpoints can be conditional, meaning that they brokebrake the code when a given PHP expression is evaluated as true. Also, they can break when a given exception is thrown or by default, the program breaks when a fatal error happens, that is, an exception that prevents the program from continuing.
Once broken into the debugger code, it can be executed one line at a time: this is called stepping. The step commands include Step Into, Step Over, and Step Out<ref>https://docs.microsoft.com/en-us/visualstudio/debugger/using-breakpoints?view=vs-2019</ref>. When the program is broken, if the mouse hovers over the variable, the current value is displayed in a tooltip, where it can be modified. The debugger allows developers to change the state of the executed program by editing the values of variables, so alternative execution paths can be examined.