[fpc-devel] Node outputting feature
Florian Klämpfl
florian at freepascal.org
Thu Dec 27 21:43:09 CET 2018
Am 23.12.2018 um 17:09 schrieb J. Gareth Moreton:
> Hi everyone,
>
> I've developed a feature to output the compiler-generated node trees into XML files that could prove useful for
> debugging purposes. While the ability to print the nodes to the console or a log file already exist, it gets buried
> especially if the System unit has its nodes output (the XML file it generated for me is 4.8 MB in size!).
>
> I plan to use this to help me debug and analyse code paths for the "pure" feature that's been on my table for a while,
> and it might help with debugging in general. I figure it's a bit more convenient than a console output because you can
> open the file afterwards in Notepad++ or some other editor that can handle XML files (which I hope are valid!!) and
> hence visually open and close branches.
>
> Note that it is currently very much a work in progress and hasn't been fully tested, and reuses a lot of features like
> the "printnodeindent" variable and an error message if it fails to access a file.
>
> To activate, specify the "-Cm" command line parameter (I wanted either "-Cn" or "-Ci", for 'node' and 'intermediate'
> respectively, but both are taken!). It's not documented at present, especially as it might be rejected or changed. The
> XML files have .ppx extensions and are placed in the output directory. Let me know how it works out for you.
While I like the possibility to output the node tree as xml, I do not think that it should be exposed to users by
command line switches. Instead, if the compiler is compiled with a certain define, it could generate xml node tree output.
More information about the fpc-devel
mailing list