[title]

Introduction

You are working on an application and you have resolved the build errors. The application seems to run correctly, except that you run from time to time into strange problems. Things are not working like expected or does even crash in some cases. Why is that? You can't say because you are unable to take a closer look to what is happening inside your application. Those errors are logic errors.

You must now correct those logic errors that keep your application from running correctly. You can do this with the development environment integrated debugging functions. These allow you to stop at procedure locations, inspect memory and register values, change variables, observe message traffic, and get a close look at how your code works or does not work.

Please note that you can have two different types of bug.

Installation

Setup Instructions

Download the PHP DBG2 from http://dd.cron.ru/
Follow the installation instructions provided by author of DBG2
Note, that you have to restart HateML Pro after DBG2 installation.

HateML Configuration

Click Tools -> Preferences -> PHP -> General and locate the php.exe, for example C:\php\php.exe
Close Preferences window by clicking OK.

Debugging

Breakpoints

Breakpoint is the line marker, which "says" debugger to stop execution at this point and wait for user action.
You can set breakpoint by pressing F5 or clicking on the gutter of editor.
You can set breakpoint at design-time and runtime as well.

Starting debug session

To start debug session, click Debug -> Start debugging or press F9
The debugger will stop on the first line of php script.

Available informations during debugging


You can watch local and globals variables during debugging.
You can also evaluate any variable (check "Immediate" tab). Just type variable or function name and press Enter

Troubleshooting

If "Start debugging" item is disabled (grayed), be sure that you have registered DbgListener.
If you are receiving "Timeout error", check if php.ini is configured properly.