[fpc-devel] XML node dump feature
J. Gareth Moreton
gareth at moreton-family.com
Tue Feb 5 18:53:31 CET 2019
Hi everyone,
As has been discussed a little bit on here in the past, I've done a bit
more work on my XML node dumping feature. If the compiler is built with
the "DEBUG_NODE_DUMP" define, all source files compiled with it will have
their intermediate nodes dumped to an XML file (they have .ppx
extensions). The patch and details can be found here:
https://bugs.freepascal.org/view.php?id=35017
It's a feature I intend to use for improving some of the mathematical
functions like "floor". Given that the nodes form trees, this is one of
the few cases where XML files are perfect for representing them, especially
as, with an appropriate editor, you can collapse trees that you're not
interested in viewing (for something like the System unit, which produces a
9 MiB .ppx file, this is almost essential).
I'm aware that a feature that dumps the nodes to the console already
exists, but for large units, like the aforementioned System unit, this is
grossly impractical because of the sheer volume of data that's printed.
Note that currently only procedures and functions are dumped to the .ppx
file - things like class declarations and global variables aren't dumped,
although being a debug-only feature, it's not overly critical. Similarly,
if it comes across an assembler block node, the assembly code is only
dumped on x86 families at present. If anyone feels like adding extra
features to it, feel free.
I hope it proves useful for future compiler debugging and development.
Gareth aka. Kit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20190205/c94adc0d/attachment.html>
More information about the fpc-devel
mailing list