New syntax for GADT-style record declarations, and associated refactoring
[ghc-hetmet.git] / docs / users_guide / debugging.xml
index d9f21f1..d6a520a 100644 (file)
 
            <varlistentry>
              <term>
+               <option>-ddump-splices</option>:
+                <indexterm><primary><option>-ddump-splices</option></primary></indexterm>
+             </term>
+             <listitem>
+               <para>Dump Template Haskell expressions that we splice in,
+                and what Haskell code the expression evaluates to.</para>
+             </listitem>
+           </varlistentry>
+
+           <varlistentry>
+             <term>
                <option>-ddump-types</option>:
                 <indexterm><primary><option>-ddump-types</option></primary></indexterm>
              </term>
 
            <varlistentry>
              <term>
+               <option>-ddump-prep</option>:
+                <indexterm><primary><option>-ddump-prep</option></primary></indexterm>
+             </term>
+             <listitem>
+               <para>output of core preparation pass</para>
+             </listitem>
+           </varlistentry>
+
+           <varlistentry>
+             <term>
                <option>-ddump-stg</option>:
                 <indexterm><primary><option>-ddump-stg</option></primary></indexterm>
              </term>
 
            <varlistentry>
              <term>
+               <option>-ddump-cmm</option>:
+                <indexterm><primary><option>-ddump-cmm</option></primary></indexterm>
+             </term>
+             <listitem>
+               <para>Print the C-- code out.</para>
+             </listitem>
+           </varlistentry>
+
+           <varlistentry>
+             <term>
+               <option>-ddump-opt-cmm</option>:
+                <indexterm><primary><option>-ddump-opt-cmm</option></primary></indexterm>
+             </term>
+             <listitem>
+               <para>Dump the results of C-- to C-- optimising passes.</para>
+             </listitem>
+           </varlistentry>
+
+           <varlistentry>
+             <term>
                <option>-ddump-asm</option>:
                 <indexterm><primary><option>-ddump-asm</option></primary></indexterm>
              </term>
       
       <varlistentry>
        <term>
-          <option>-dverbose-core2core</option>
-          <indexterm><primary><option>-dverbose-core2core</option></primary></indexterm>
-        </term>
-       <term>
-          <option>-dverbose-stg2stg</option>
-          <indexterm><primary><option>-dverbose-stg2stg</option></primary></indexterm>
+          <option>-ddump-simpl-phases</option>:
+          <indexterm><primary><option>-ddump-simpl-phases</option></primary></indexterm>
         </term>
        <listitem>
-         <para>Show the output of the intermediate Core-to-Core and
-        STG-to-STG passes, respectively.  (<emphasis>Lots</emphasis>
-        of output!) So: when we're really desperate:</para>
-
-         <screen>
-% ghc -noC -O -ddump-simpl -dverbose-simpl -dcore-lint Foo.hs
-</screen>
-
+         <para>Show the output of each run of the simplifier.  Used when even
+        <option>-dverbose-simpl</option> doesn't cut it.</para>
        </listitem>
       </varlistentry>
-      
+
       <varlistentry>
        <term>
           <option>-ddump-simpl-iterations</option>:
        <listitem>
          <para>Show the output of each <emphasis>iteration</emphasis>
         of the simplifier (each run of the simplifier has a maximum
-        number of iterations, normally 4).  Used when even
-        <option>-dverbose-simpl</option> doesn't cut it.</para>
+        number of iterations, normally 4).  This outputs even more information
+        than <option>-ddump-simpl-phases</option>.</para>
        </listitem>
       </varlistentry>
 
       <varlistentry>
        <term>
-          <option>-dppr-debug</option>
-          <indexterm><primary><option>-dppr-debug</option></primary></indexterm>
+          <option>-ddump-simpl-stats</option>
+          <indexterm><primary><option>-ddump-simpl-stats option</option></primary></indexterm>
         </term>
        <listitem>
-         <para>Debugging output is in one of several
-          &ldquo;styles.&rdquo; Take the printing of types, for
-          example.  In the &ldquo;user&rdquo; style (the default), the
-          compiler's internal ideas about types are presented in
-          Haskell source-level syntax, insofar as possible.  In the
-          &ldquo;debug&rdquo; 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.</para>
+         <para>Dump statistics about how many of each kind of
+        transformation too place.  If you add
+        <option>-dppr-debug</option> you get more detailed
+        information.</para>
        </listitem>
       </varlistentry>
 
       <varlistentry>
        <term>
-          <option>-dppr-user-length</option>
-          <indexterm><primary><option>-dppr-user-length</option></primary></indexterm>
+          <option>-ddump-if-trace</option>
+          <indexterm><primary><option>-ddump-if-trace</option></primary></indexterm>
         </term>
        <listitem>
-         <para>In error messages, expressions are printed to a
-         certain &ldquo;depth&rdquo;, with subexpressions beyond the
-         depth replaced by ellipses.  This flag sets the
-         depth.</para>
+         <para>Make the interface loader be *real* chatty about what it is
+       upto.</para>
        </listitem>
       </varlistentry>
 
       <varlistentry>
        <term>
-          <option>-ddump-simpl-stats</option>
-          <indexterm><primary><option>-ddump-simpl-stats option</option></primary></indexterm>
+          <option>-ddump-tc-trace</option>
+          <indexterm><primary><option>-ddump-tc-trace</option></primary></indexterm>
         </term>
        <listitem>
-         <para>Dump statistics about how many of each kind of
-        transformation too place.  If you add
-        <option>-dppr-debug</option> you get more detailed
-        information.</para>
+         <para>Make the type checker be *real* chatty about what it is
+       upto.</para>
        </listitem>
       </varlistentry>
 
 
       <varlistentry>
        <term>
-          <option>-dshow-unused-imports</option>
-          <indexterm><primary><option>-dshow-unused-imports</option></primary></indexterm>
+          <option>-dverbose-core2core</option>
+          <indexterm><primary><option>-dverbose-core2core</option></primary></indexterm>
+        </term>
+       <term>
+          <option>-dverbose-stg2stg</option>
+          <indexterm><primary><option>-dverbose-stg2stg</option></primary></indexterm>
+        </term>
+       <listitem>
+         <para>Show the output of the intermediate Core-to-Core and
+        STG-to-STG passes, respectively.  (<emphasis>Lots</emphasis>
+        of output!) So: when we're really desperate:</para>
+
+         <screen>
+% ghc -noC -O -ddump-simpl -dverbose-simpl -dcore-lint Foo.hs
+</screen>
+
+       </listitem>
+      </varlistentry>
+      
+      <varlistentry>
+       <term>
+          <option>-dshow-passes</option>
+          <indexterm><primary><option>-dshow-passes</option></primary></indexterm>
+        </term>
+       <listitem>
+         <para>Print out each pass name as it happens.</para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
+       <term>
+          <option>-dfaststring-stats</option>
+          <indexterm><primary><option>-dfaststring-stats</option></primary></indexterm>
+        </term>
+       <listitem>
+         <para>Show statistics for the usage of fast strings by the
+          compiler.</para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
+       <term>
+          <option>-dppr-debug</option>
+          <indexterm><primary><option>-dppr-debug</option></primary></indexterm>
+        </term>
+       <listitem>
+         <para>Debugging output is in one of several
+          &ldquo;styles.&rdquo; Take the printing of types, for
+          example.  In the &ldquo;user&rdquo; style (the default), the
+          compiler's internal ideas about types are presented in
+          Haskell source-level syntax, insofar as possible.  In the
+          &ldquo;debug&rdquo; 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.</para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
+       <term>
+          <option>-dsuppress-uniques</option>
+          <indexterm><primary><option>-dsuppress-uniques</option></primary></indexterm>
         </term>
        <listitem>
-         <para>Have the renamer report what imports does not
-       contribute.</para>
+         <para>Suppress the printing of uniques in debugging output. This may make 
+         the printout ambiguous (e.g. unclear where an occurrence of 'x' is bound), but
+         it makes the output of two compiler runs have many fewer gratuitous differences,
+           so you can realistically apply <command>diff</command>.  Once <command>diff</command>
+         has shown you where to look, you can try again without <option>-dsuppress-uniques</option></para>
        </listitem>
       </varlistentry>
+
+      <varlistentry>
+       <term>
+          <option>-dppr-user-length</option>
+          <indexterm><primary><option>-dppr-user-length</option></primary></indexterm>
+        </term>
+       <listitem>
+         <para>In error messages, expressions are printed to a
+         certain &ldquo;depth&rdquo;, with subexpressions beyond the
+         depth replaced by ellipses.  This flag sets the
+         depth.  Its default value is 5.</para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term>
+          <option>-dno-debug-output</option>
+          <indexterm><primary><option>-dno-debug-output</option></primary></indexterm>
+        </term>
+        <listitem>
+          <para>Suppress any unsolicited debugging output.  When GHC
+            has been built with the <literal>DEBUG</literal> option it
+            occasionally emits debug output of interest to developers.
+            The extra output can confuse the testing framework and
+            cause bogus test failures, so this flag is provided to
+            turn it off.</para>
+        </listitem>
+      </varlistentry>
     </variablelist>
   </sect2>
 
        </listitem>
       </varlistentry>
 
+      <varlistentry>
+       <term>
+          <option>-dcmm-lint</option>:
+          <indexterm><primary><option>-dcmm-lint</option></primary></indexterm>
+        </term>
+       <listitem>
+         <para>Ditto for C-- level.</para>
+       </listitem>
+      </varlistentry>
+
     </variablelist>
   </sect2>
 
@@ -507,21 +630,9 @@ Main.skip2{-r1L6-} =
     of platform-specific code that needs to be written in order to get
     unregisterised compilation going is usually fairly small.</para>
 
-    <variablelist>
-      <varlistentry>
-       <term>
-          <option>-unreg</option>:
-          <indexterm><primary><option>-unreg</option></primary></indexterm>
-        </term>
-       <listitem>
-         <para>Compile via vanilla ANSI C only, turning off
-         platform-specific optimisations.  NOTE: in order to use
-         <option>-unreg</option>, you need to have a set of libraries
-         (including the RTS) built for unregisterised compilation.
-         This amounts to building GHC with way "u" enabled.</para>
-       </listitem>
-      </varlistentry>
-    </variablelist>
+   <para>Unregisterised compilation cannot be selected at
+   compile-time; you have to build GHC with the appropriate options
+   set.  Consult the GHC Building Guide for details.</para>
   </sect2>
 
 </sect1>