Some notes on Delphi Debugger Visualizers
Posted by jpluimers on 2026/06/16
Ever since Chris Hesik spoke on “RAD Studio 2010 what’s new in the IDE debugger”, wanted to write a blog post about it.
Still haven’t found time to do that in depth, but it’s important to at least jot a few notes, so let’s start with the 20111020 conference session notes.
Chris Hesik – RAD Studio 2010 what’s new in the IDE debugger
| Built-in: | Roll your own: |
|---|---|
|
|
http://stackoverflow.com/questions/1425988/a-simple-debug-visualizer-for-delphi-2010
http://stackoverflow.com/questions/2556146/improve-speed-of-own-debug-visualizer-for-delphi-2010
http://www.torry.net/pages.php?id=1627
Tools – Options – Visualizers: enable the ones you need
- Replace visualizer: replaces the value from the debugger with something more meaningful
- External Viewer visualizer: small Glyph is added that allows you to popup
- Evaluate/Modify dialog
Older Delphi versions: http://www.dewresearch.com/DebuggerVisualizer.html
Write your own:
- ToolsApi.pas file
- IOTADebuggerVisualizer interface
- IOTADebuggerVisualizerValueReplacer
- IOTADebuggerVisualizerExternalViewer
- IOTADebuggerSerivices: Register/UnregisterDebugVisuaizer
- Source\Win32\Visualizers sample code
Back in the days, Chris Hesik was the person I went to in case I bumped into debugger oddities. He used to have a blog at Embarcadero: [Wayback/Archive] Chris’ Debugger Blog
But after leaving for AMD, his blog got deleted: [Wayback/Archive] Error!
Links
The rest of the blog post is a link dump:
- The above mentioned [Wayback/Archive] Dew Research: Debugger visualizer for MtxVec has since then moved to [Wayback/Archive] Debugger visualizer for MtxVec and now has this download:
- [Wayback/Archive] extending-the-delphi-ide.pdf [Wayback PDF View/PDF View]
- The debugger visualizer is a part of a package named MtxVisualizer*.dproj.
- Even though these types are defined within MtxVec product in the Math387.pas unit, if the name of the type is a match, but the type is defined in a different unit, the visualizer will still work. However, if the layout of the structure is different, but the name will match, this will crash the visualizer and the debugger. The arrays could be made pinnable, but the support for this is still missing.
The above are just some excerpts of the documentation.
- [Wayback/Archive] extending-the-delphi-ide.pdf [Wayback PDF View/PDF View]
- [Wayback/Archive] Code snippet: IDE debug visualizer plugin for generic and template types by [Wayback/Archive] David Millington which is useful, but all source files start with a
., so I copied the individual source files here: [Wayback/Archive] Archived version of “Code snippet: IDE debug visualizer plugin for generic and template types” · GitHub - [Wayback/Archive] extending-the-delphi-ide.pdf [Wayback PDF View/PDF View] has a chapter covering Debug Visualisers
- [Wayback/Archive] The Delphi Open Tools API Book 1.1 – Dave’s Development Blog used to be on-line and downloadable as [Wayback/Archive] Archive [Wayback PDF View] (the archived links still function), but the domain expired and I’m not sure what happened to David Hoyle. He has not been active on [Wayback/Archive] David Hoyle – Delphi-PRAXiS [en] for a while either. Luckily he is still somewhat active on [Wayback/Archive] DGH2112 (David Hoyle) · GitHub. Prior blog posts where I mentioned David Hoyle in reverse chronological order of writing:
- The Delphi Open Tools API Book 1.1 – Dave’s Development Blog
- Happy Delphi 25th anniversary: follow hash tags #Delphi25 and #Delphi25th
- IOTAProjectNotifier.Modified notifies when when Project Options have changed…
- Updating Actions (Don’t Do This) – Dave’s Development Blog
- Fl Ko: Getting the pixel position of the current editor cursor position for an OTA wizard
- GitHub – NickRing/Delphi-Shortcut-Finder: Shows/find keyboard short-cuts have be assigned, that may be conflicting.
- Stefaan Lesage: use the OpenTools API to get one of my TCustomModule descendants in the current project
- Getting the up to date project source code from the IDE – Dave’s Development Blog
- RAD Studio Custom Editor Sub-views – Dave’s Development Blog
- Delphi: IOTASourceEditor uses UTF8, so conversions are needed to/from regular strings
- GitHub – NickRing/Delphi-Shortcut-Finder: Shows/find keyboard short-cuts have be assigned, that may be conflicting.
- Dave’s Development Blog – Using CodeSite on interfaced objects
- Cyclomatic Complexity of switch case statement – Stack Overflow
- Debugging RTL/VCL Code with CodeSite – Dave’s Development Blog
- Delphi – finding published event handlers that have lost their binding from the DFM
- Maybe one day the Object Inspector gets a real overhaul
- RSS feed for Dave’s Development Blog – mostly OTA articles on the Open Tools API for Delphi and C++ Builder
- Record helpers can do wonders for code clarity.
- Notify me of everything… – Part 1 – Dave’s Development Blog
Regrettably [Wayback/Archive] David Hoyle has a new blog – twm’s blog pointed to the old blog [Wayback/Archive] Dave’s Development Blog – Software Development using Borland / Codegear / Embarcadero RAD Studio.Luckily a .docx draft version 1.2 and most (all?) of his blog posts are in .pdf at [Wayback/Archive] GitHub – DGH2112/The-Open-Tools-API-Project: This is a collection of code and articles for my Open Tools API blog post. This is the 1.2 version:
- [Wayback/Archive] The-Open-Tools-API-Project/The Delphi IDE Open Tools API – Version 1.2.docx at master · DGH2112/The-Open-Tools-API-Project · GitHub
Note that his document has very few
I*TADebugger*examples. - Later, because of a reference in [Wayback/Archive] OTAPI-Docs/Roundtable Notes.md at main · Embarcadero/OTAPI-Docs · GitHub, I found that that a copy of the new 1.2 version of the .docx and as badly converted .md file are here as well:
- [Wayback] github.com/Embarcadero/OTAPI-Docs/blob/main/The Delphi IDE Open Tools API – Version 1.2.docx
- [Wayback/Archive] OTAPI-Docs/The Delphi IDE Open Tools API – Version 1.2.md at main · Embarcadero/OTAPI-Docs · GitHub
It is part of this – regrettably hardly updated, see [Wayback/Archive] ToolsAPI · Embarcadero/OTAPI-Docs Wiki · GitHub – repository: [Wayback/Archive] GitHub – Embarcadero/OTAPI-Docs: Collaborative documentation to expand the Open Tools API documentation.
Almost all of it’s content is boilerplate; the most recent update series was about the plugin on the Gemini (language plugin, not constellation):
[Wayback/Archive] OTAPI-Docs/examples/AIEngines/GeminiAIPlugin at main · Embarcadero/OTAPI-Docs · GitHub
Tjos repository is yet an example where Embarcadero defers actual work to volunteers the Delphi community, while making money of the product.
- [Wayback/Archive] Universal Debug Visualizer for Delphi – Tips / Blogs / Tutorials / Videos – Delphi-PRAXiS [en]
…
You can only call methods and functions that you could also use in the unit being debugged. So make sure you include the unit that exports these in the uses clause.
…
thanks
I use this expression
UIntToStr({Expression}) + ' ($' + (IntToHex({Expression}, SizeOf(UInt64) * 2)) + ')'Successfully displayed the decimal and hexadecimal values of UINT64
…
You can see dummzeuch (Thomas Müller, also known as twm) did tremendous work, on which he wrote a few blog posts:
- [Wayback/Archive] dzDebugVisualizers for Delphi 2005 and up – twm’s blog
- [Wayback/Archive] dzDebugVisualizers for Delphi 2005, 2006 and 2007 – twm’s blog
- [Wayback/Archive] dzDebugVisualizer source code available – twm’s blog
- [Wayback/Archive] added support for TColor and Local Variables to dzDebugVisualizer – twm’s blog
- [Wayback/Archive] (Multi line) string Debug Visualizer for Delphi 10.2 – twm’s blog
- [Wayback/Archive] Simplified Debug Visualizers for all my TNullableTypes – twm’s blog
- [Wayback/Archive] Universal Debug Visualizer for Delphi – twm’s blog
The cool thing about his Debug Visualisers is that they work from Delphi 2005 until the most recent Delphi versions. You can find the source code at:
- [Wayback/Archive] GitHub – peter-aryanto/Delphi-DataSetVisualizer: Delphi External Viewer for DataSet (DataSet Visualizer) is one I wish I had written myself a long time ago.
- [Wayback/Archive] Delphi-DataSetVisualizer/DataSetVisualizerFrame.pas at master · peter-aryanto/Delphi-DataSetVisualizer · GitHub
- [Wayback/Archive] Delphi-DataSetVisualizer/DataSetVisualizerFrame.dfm at master · peter-aryanto/Delphi-DataSetVisualizer · GitHub is a really simple construct, basically: DBGridOutput: TDBGrid -> DataSourceOutput: TDataSource -> ClientDataSetOutput: TClientDataSet
BTW: I like that he uses almost the same naming conventions as I do: functionality at the front, technical details at the end and no abbreviations. Great!
- [Wayback/Archive] Delphi Open Tools API: Notifiers showed the state more than 25 years ago, around the Delphi 5 release: back then it was not implemented and hacking your way around it was hard.
IOTADebuggerNotifier- Not implemented. Delphi never calls its methods. Without this, the other debugger notifiers are almost useless. In particular, your wizard cannot learn when the user starts a process, so the wizard can register a process notifier. Nor does your wizard learn about new or modified breakpoints, so it can set a breakpoint notifier. See the Debugger page for more information.
- [Wayback/Archive] Delphi Open Tools API: Debugger
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.
…
- [Wayback/Archive] debugging – How to do a very simple debug value replacer for Delphi? – Stack Overflow (thanks [Wayback/Archive] maf-soft for asking, and [Wayback/Archive] MartynA and [Wayback/Archive] Remy Lebeau for commenting. I wish I could thank [Wayback/Archive] Rudy Velthuis for commenting too, but he sadly passed away in May 2019 – see Im memoriam: Rudy Velthuis)
Q
Why do we need so much code just to tell the debugger to call .ToString on some objects?I looked at the included examples underC:\Program Files (x86)\Embarcadero\Studio\19.0\source\Visualizersand adapted them for one of my objects – it works well.Is there an easier way?unit uMyObjectDebugVisualizer; interface procedure Register; implementation uses Classes, Forms, SysUtils, ToolsAPI; type TMyObjectDebugVisualizer = class(TInterfacedObject, IOTADebuggerVisualizer, IOTADebuggerVisualizerValueReplacer, IOTAThreadNotifier, IOTAThreadNotifier160) private FNotifierIndex: Integer; FCompleted: Boolean; FDeferredResult: string; public { IOTADebuggerVisualizer } function GetSupportedTypeCount: Integer; procedure GetSupportedType(Index: Integer; var TypeName: string; var AllDescendants: Boolean); function GetVisualizerIdentifier: string; function GetVisualizerName: string; function GetVisualizerDescription: string; { IOTADebuggerVisualizerValueReplacer } function GetReplacementValue(const Expression, TypeName, EvalResult: string): string; { IOTAThreadNotifier } procedure EvaluteComplete(const ExprStr: string; const ResultStr: string; CanModify: Boolean; ResultAddress: Cardinal; ResultSize: Cardinal; ReturnCode: Integer); procedure ModifyComplete(const ExprStr: string; const ResultStr: string; ReturnCode: Integer); procedure ThreadNotify(Reason: TOTANotifyReason); procedure AfterSave; procedure BeforeSave; procedure Destroyed; procedure Modified; { IOTAThreadNotifier160 } procedure EvaluateComplete(const ExprStr: string; const ResultStr: string; CanModify: Boolean; ResultAddress: TOTAAddress; ResultSize: LongWord; ReturnCode: Integer); end; { TMyObjectDebugVisualizer } … finalization RemoveVisualizer; end.To get this working, you have to add it to a package. Also add “designide.dcp” to the required packages.C
“Why do we need so much code …” I think that’s just the way it is, working with OTA. There’s typically a certain amount of of faffing around, but ime it’s more a question of verbose declarations than verbose or complex code. Have you seen this, btw: davidghoyle.co.uk/WordPress/?tag=ota
C
“Is there an easier way?” – not really. Writing a debug visualizer is not a trivial task in general. The sample visualizers for
TDateTimeandstd::(w)stringthat come with the IDE are about as simple as you can get. I’m actually a little surprised that Embarcadero didn’t provider a simpler visualizer API, or at least provide reusable base classes, for making visualizer development easier.C
@MartynA: It not just the OTA, it also that you must parse what the IDE gives you, e.g. for my BigIntegers, it is something like
'(FData:(4294967295 {$FFFFFFFF}, 4294967295 {$FFFFFFFF}, 4294967295 {$FFFFFFFF}, 0, 0, 0, 0, 0); FSize:3)'. The Visualizer must parse that and then turn it into a BigInteger again, so it can call its .ToString. Note that this BigInteger only has 3 limbs. They can have hundreds, thousands and even millions. And BigDecimal is even a little more complex.C
@RudyVelthuis, see my solution above, I didn’t have to parse:
Evaluate(Expression + '.ToString', ...)– that’s quite nice – if it was the only required line of code :)C
@maf-soft: Perhaps you didn’t, but I had to.
The above is the question and a selection of the comments. Given Stack Overflow is kind of dead , I archived the above question and comments with the full source code of the unit at [Wayback/Archive] Archived copy of “How to do a very simple debug value replacer for Delphi?” · GitHub
- [Wayback/Archive] Debugger Visualizer | Danny Wind basically can be summarised as:
De belangrijkste method (overerfd van IOTADebuggerVisualizerValueReplacer ) is GetReplacementValue. Hier vindt de werkelijke vertaling plaats.
- [Wayback/Archive] GitHub – RoutineOp/TeeParser: Delphi AST (which is a different Abstract Syntax Tree than [Wayback/Archive] GitHub – RomanYankovsky/DelphiAST: Abstract syntax tree builder for Delphi) also has a Debug Visualiser:
- [Wayback/Archive] TeeParser/TeeCodeVisualizer.pas at master · RoutineOp/TeeParser · GitHub
- [Wayback/Archive] TeeParser/TeeCodeVisualizer.dfm at master · RoutineOp/TeeParser · GitHub
Note that there is also an (unmaintained) BNF grammar for Delphi at [Wayback/Archive] GitHub – MHumm/DelphiGrammar: Grammer for Embarcadero Delphi in BNF form with the BNF from Davoid Hoyle (:
- [Wayback/Archive] GitHub – grings/StringVisualizerDelphi: Delphi IDE Visualizer for a string.
- [Wayback/Archive] StringVisualizerDelphi/StringVisualizer.pas at main · grings/StringVisualizerDelphi · GitHub
- [Wayback/Archive] StringVisualizerDelphi/StringVisualizer.dfm at main · grings/StringVisualizerDelphi · GitHub
It was derived from [Wayback/Archive] GitHub – rgreat/StringVisualizer: Delphi IDE Visualizer for a string..
- [Wayback/Archive] rtapson (Randy Tapson) · GitHub has a few interesting repositories including [Wayback/Archive] GitHub – rtapson/BitVisualizer which displays byte values in binary:
- [Wayback/Archive] BitVisualizer/BitVisualizer.pas at main · rtapson/BitVisualizer · GitHub has
sBitVisualizerDescription = 'Displays Decimal, Hex and Binary representations of Byte type';but I am not sure it does decimal and hexadecimal yet.
- [Wayback/Archive] BitVisualizer/BitVisualizer.pas at main · rtapson/BitVisualizer · GitHub has
-
- [Wayback/Archive] GitHub – rtapson/AutoMapper4D: A small Delphi project to automate mapping of entity objects to domain objects. which is similar to [Wayback/Archive] AutoMapper: The Object-Object Mapper – AutoMapper (repository at [Wayback/Archive] GitHub – LuckyPennySoftware/AutoMapper: A convention-based object-object mapper in .NET.)
- [Wayback/Archive] AutoMapper4D/AutoMapper.pas at master · rtapson/AutoMapper4D · GitHub is the main source file
- [Wayback/Archive] AutoMapper4D/uFuzzyStringMatch.pas at master · rtapson/AutoMapper4D · GitHub has a Delphi implementation of the Damerau–Levenshtein distance – Wikipedia which I remember having written for a client in the Turbo Pascal days, but lost source code to.
- [Wayback/Archive] GitHub – rtapson/AutoMapper4D: A small Delphi project to automate mapping of entity objects to domain objects. which is similar to [Wayback/Archive] AutoMapper: The Object-Object Mapper – AutoMapper (repository at [Wayback/Archive] GitHub – LuckyPennySoftware/AutoMapper: A convention-based object-object mapper in .NET.)
- a
Documentation
Old documentation, including valuable blogs and forum posts, is gone so it now boils down to what is currently available:
[Wayback/Archive] ToolsAPI – RAD Studio API Documentation
The numbers at the end of some identifiers correspond to the Package Version in [Wayback/Archive] Compiler Versions – RAD Studio (the version of the .BPL files). It means that in these versions of Delphi, changes were made:
- 60: Delphi 6.0
- 90: Delphi 2005 (9.0)
- 100: Delphi 2006 (10.0)
- 110: Delphi 2007 (11.0)
- 120: Delphi 2009 (12.0)
- 150: Delphi XE (15.0)
- 250: Delphi 10.2 Tokyo (25.0)
I tried adding links to the respective (and archived) documentation pages if they contain more than just the auto-generated bits (i.e. a “Descrption”different from “Embarcadero Technologies does not currently have any additional information.”, but there were none.
After 15+ years, Embarcadero has failed to document all the ITADebugger identifiers.
Queries
- [Wayback/Archive] toolsapi at DuckDuckGo
- [Wayback/Archive] ToolsApi.pas “Unit ToolsApi” at DuckDuckGo
- [Wayback/Archive] IOTADebuggerNotifier at DuckDuckGo
- [Wayback/Archive] IOTADebuggerVisualizer at DuckDuckGo
- [Wayback/Archive] IOTADebuggerVisualizer250 at DuckDuckGo
- [Wayback/Archive] IOTADebuggerVisualizerExternalViewerUpdater at DuckDuckGo
- [Wayback/Archive] IOTADebuggerVisualizerValueReplacer at DuckDuckGo
- [Wayback/Archive] IOTAThreadNotifier at DuckDuckGo
- [Wayback/Archive] IOTAThreadNotifier160 at DuckDuckGo
--jeroen






Leave a comment