Debugging windows

When debugging Php applications there are various windows you would like to use to increase your productivity. If you are already familiar with Visual Studio .Net these windows are the ones you typically use to debug .Net applications. Let us review these windows and discuss the function of each one of them.

Watch window

The watch window lets you enter variables you would like to see their value as you debug your application. Variables that change values while you debug are marked in red while the others are black. You can add objects and arrays to the watch window. You can also change the value of the variable at any time by simply updating the value field in the watch window. The following shows a sample watch window:

Local variables watch window

XDebug supports the local variables watch window. This window shows all the local variables available to the given location in code. This list is more extensive than the automatic variables watch window which only shows the immediate variables in the current location in code.



Breakpoints window

The breakpoints window lets you manage the existing breakpoints on your project. You can add, edit, remove and/or disable them. The window also gives you other properties of the breakpoint like location.



Callstack window

The callstack window is a very useful window that lets you see all the functions in the stack for a given point. You can select any entry in the callstack to jump to the source code location of the call. Using the callstack can help track complex issues with ease by looking at the history of how your functions are getting called. The callstack window can also be used to detect possible stack overflow issues typically found in recursive functions.



Threads window

VS.Php shows multiple requests been debugged as different threads in the debugger. You can move from one request to the other by simply selecting the thread in the thread window. Use this feature when you are debugging concurrency issues between multiple requests.