[fpc-devel] What's the best way to debug the fpc compiler?

Sven Barth pascaldragon at googlemail.com
Thu Dec 28 14:54:03 CET 2017

Am 28.12.2017 11:30 schrieb "Giuliano Colla" <giuliano.colla at fastwebnet.it>:

Hi fpc developers,

I'm playing a bit with the compiler. In order to debug my changes I need to
compile some test programs.

To stay on the safe side, currently when I modify something I rebuild
everything (make all - make install) in order to provide a consistent
compilation environment.

This is rather time consuming and I do compile a lot of unnecessary stuff.
Is there a better way?

Any suggestion is welcome

As long as you don't have static changes (e.g. what is written to PPUs)
it's sufficient to build the correct compiler using the Lazarus project
(e.g. ppcx64.lpi he the x86_64 compiler) and set the run parameters
accordingly (I for example use "-n -Furtl/units/x86_64-linux -viwn -
FEtestoutput ./fpctests/whatever.pp" with the current directory set to the
FPC  directory). With that it is enough to have done a single "make all"
beforehand. Depending on the required units for the test I also sometimes
rebuild only the RTL.
When I'm satisfied with my changes I do a complete rebuild and run the
testsuite to compare the resulting list of failures to the one without my
A "make install" I do only when I need to use the compiler in Lazarus for a
different project, for everything else I simply add the unit directories of
the needed packages to the run parameters.

I hope this helps you :)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20171228/20ddf04f/attachment.html>

More information about the fpc-devel mailing list