Debugging GHC

Consistency checking flags

Add -dcore-lint the GHC command line when compiling each Haskell module. This makes GHC type-check the intermediate program after every optimisation pass, which often nails a fault.

Add -ddump-simpl to see the optimised Core output. There are a number of other -ddump-x flags; see the user manual.

The flag -dppr-debug makes the -ddump-x flags print much more verbose output. Use this if you are getting desperate!

At link time:

Add -debug to the GHC command line when linking. This links the program against a special version of the runtime system that does lots of extra internal consistency checking. Overall performance is significantly reduced. Simon: any flags?