This section is a quick-reference for GHC's command-line flags. For each flag, we also list its static/dynamic status (see Section 4.2), and the flag's opposite (if available).
| Flag | Description | Static/Dynamic | Reverse |
|---|---|---|---|
| -? | help | static | - |
| -help | help | static | - |
| -v | verbose mode (equivalent to -v3) | dynamic | - |
| -vn | set verbosity level | dynamic | - |
| -V | display GHC version | static | - |
| ––version | display GHC version | static | - |
| ––numeric-version | display GHC version (numeric only) | static | - |
| ––print-libdir | display GHC library directory | static | - |
| Flag | Description | Static/Dynamic | Reverse | |
|---|---|---|---|---|
| --interactive | Interactive mode - normally used by just running ghbD
> dumps all rewrite rules (including those generated by the specialisation pass) simplifer output (Core-to-Core passes) inlining info from the simplifier UsageSP inference pre-inf and output CPR analyser output strictness analyser output CSE pass output worker/wrapper split output `occurrence analysis' output output of “saturate” pass output of STG-to-STG passes unflattened Abstract C flattened Abstract C same as what goes to the C compiler native-code generator intermediate form assembly language from the native-code generator byte code compiler output dump foreign export stubs Show the output of the intermediate Core-to-Core and STG-to-STG passes, respectively. (Lots of output!) So: when we're really desperate:
Show the output of each iteration of the simplifier (each run of the simplifier has a maximum number of iterations, normally 4). Used when even -dverbose-simpl doesn't cut it. Debugging output is in one of several “styles.” Take the printing of types, for example. In the “user” style (the default), the compiler's internal ideas about types are presented in Haskell source-level syntax, insofar as possible. In the “debug” style (which is the default for debugging output), the types are printed in with explicit foralls, and variables have their unique-id attached (so you can check for things that look the same but aren't). This flag makes debugging output appear in the more verbose debug style. In error messages, expressions are printed to a certain “depth”, with subexpressions beyond the depth replaced by ellipses. This flag sets the depth. Dump statistics about how many of each kind of transformation too place. If you add -dppr-debug you get more detailed information. Make the renamer be *real* chatty about what it is upto. Print out summary of what kind of information the renamer had to bring in. Have the renamer report what imports does not contribute. 4.16.2. Checking for consistency
4.16.3. How to read Core syntax (from some -ddump flags)Let's do this by commenting an example. It's from doing -ddump-ds on this code:
Remember, everything has a “Unique” and it is usually printed out when debugging, in some form or another. So here we go…
(“It's just a simple functional language” is an unregisterised trademark of Peyton Jones Enterprises, plc.) 4.16.4. Unregisterised compilationThe term "unregisterised" really means "compile via vanilla C", disabling some of the platform-specific tricks that GHC normally uses to make programs go faster. When compiling unregisterised, GHC simply generates a C file which is compiled via gcc. Unregisterised compilation can be useful when porting GHC to a new machine, since it reduces the prerequisite tools to gcc, as, and ld and nothing more, and furthermore the amount of platform-specific code that needs to be written in order to get unregisterised compilation going is usually fairly small.
|