Next Previous Up Top Contents Index

6 Debugging and Interactive Development

6.16 Just-in-time debugging

Note: This section does not apply to the Functional Developer Personal Edition.

The Windows operating system has the built-in capability to perform "just-in-time" debugging. Just-in-time, or JIT, debugging is where an application crashes while not running under a debugger, and the operating system arranges to start up an available debugger and attach it to the crashed process in order to obtain a backtrace. The system registry contains an entry for the debugger that should be invoked when this happens. The Functional Developer Professional and Enterprise Editions are capable of acting as a JIT debugger; during the installation process you have the opportunity to install Functional Developer as your machine's default debugger.

If you set Functional Developer up as your JIT debugger, it is simple to make a connection to the Functional Developer debugger "just in time". When the application signals an error, and that error is unhandled, the operating system displays a dialog giving you a chance to attach to a debugger. If you then click Debug in the dialog, the Functional Developer debugger can attach to the application.

That is the procedure for console applications. Attaching the debugger to a DUIM application takes slightly longer. DUIM applications have a default-handler method that displays a standard dialog describing the unhandled Dylan error, and offering the chance to terminate the application (Yes button), ignore the error (No button), or debug the application (Cancel button). This is the dialog that we saw in "Problems at run time" on page 24.

To attach the debugger in this situation, click Cancel. Because the application is not running under a debugger already, the error falls through to be caught by the operating system. At this point, the operating system displays its dialog and you can click Debug to make the Functional Developer debugger attach.

Once the debugger attaches successfully, another dialog appears, asking whether you would like to open a project. If the crashed process is a Dylan application for which you have a project, you should take this opportunity to open the related project before you start your debugging.

It is not strictly necessary to open a project, since the debugger will still be able to use whatever debugging information is available in the executable file itself in order to provide a backtrace. But it is worth opening a project because you can then browse the source code or the definitions in the project, and use the interactor to evaluate Dylan expressions.

(Of course, if the crashed application is not a Dylan application at all, and also does not contain any embedded Dylan components, then you will not be able to open a project.)

Once you have made your selection and have clicked OK, the Functional Developer debugger window appears. The debugger provides a full description of the state of the program at the point of the crash. You can then start to debug the application in the normal way.


Getting Started with Functional Developer - 31 MAR 2000

Next Previous Up Top Contents Index