Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to write extensions to Delphi's debugger?

I know there's an API for creating extensions to Delphi. I use the GExperts package and various JVCL experts frequently. But I've never seen any extensions to the debugger. It would be very nice, for example, to be able to register viewers for various objects instead of having to examine them in the Inspector. (A form with an image control that displays a TImage, for example, or a grid that displays the contents of a dataset.)

Are there any APIs that allow you to extend Delphi's debugger in this way?

EDIT: This wasn't available back when I wrote the question, but Delphi 2010 provides a way to do it.

like image 858
Mason Wheeler Avatar asked Jan 16 '09 03:01

Mason Wheeler


2 Answers

In ToolsAPI.pas source there is some API interfaces for debugging. You can be informed when a debugging event occurred, info about breakpoints, which process is being debugged etc. with this API. But it seems there is no support for variables or values of them. So there is no easy way to implement your requisition without ugly hacks.

like image 107
Khan Avatar answered Oct 20 '22 11:10

Khan


Basic debugger visualizers can be implemented with the Evaluation interfaces exposed by the OTA. (Examples for debugger visualizers can be found here and here.)

A deeper integration into the debugger is possible as well (for example, I wrote a little extension for C++Builder that enables the debugger to evaluate the actual objects behind an interface) - but as Khan pointed out, to achieve such a level of integration, you'll need to resort to quite a few dirty hacks.

like image 41
Moritz Beutel Avatar answered Oct 20 '22 11:10

Moritz Beutel