Home

Tools API

Debugger

Open Tools API

Introduction
Services
Wizards
Messages
Notifiers
Creators
Editors
Debugger
Examples
Custom Forms

Home

The debugger interfaces are brand new in the new API. They don't all work, though. In particular, the debugger notifier interface doesn't work, and without it, the remaining debugger interfaces aren't much use. If you're desperate, you can hack around the limitations a little bit.

For example, instead of using the Run>Run command to start your debugging session, create a wizard that defines a new Run menu item. Your wizard can call IOTADebuggerServices.CreateProcess to start the process, then set a process notifier on each process by iterating through the Processes[] property of IOTADebuggerServices. Your wizard isn't notified if the application spawns subprocesses, but most application don't.

Once your wizard has defined its initial process notifiers, they work correctly, and you can define thread notifiers when the processes create threads, and define process module notifiers if they strike your fancy.

CreateProcess always creates its process initially stopped. You can use a thread notifier to detect this and restart the process automatically.

If you dare to use the breakpoint interfaces, watch out!

When the user modifies a breakpoint, Delphi frees the old interface and creates a new one. Because the debugger notifier doesn't work, your wizard has no way of knowing when this happens.

Also, everytim I use the Edit method of IOTADebugger, I get an error: instance of Class TBreakpoint has dangling reference count of 2. This is no surprise: my wizard must hold a reference in order to call the Edit method. The same thing happens when I use Destruct. Don't do it.

Because of all these problems, I haven't used the debugger interfaces much.

One more thing. If you access a thread's context to get to the FPU state, each number's exponent is stored on the opposite end of the number from what you might expect. To convert the context value to a valid floating point number, you must move the exponent to the other side, then convert it to a floating point number.

Copyright © 1998 Tempest Software, Inc. All rights reserved.