[fpc-devel] Node outputting feature

J. Gareth Moreton gareth at moreton-family.com
Sun Dec 23 17:09:37 CET 2018


 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.
 Gareth aka. Kit

 (The patch file may be too large and cause this e-mail to be flagged by
the moderators)
  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20181223/7e01be95/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xml-node-output.patch
Type: application/octet-stream
Size: 67330 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20181223/7e01be95/attachment.obj>


More information about the fpc-devel mailing list