summaryrefslogtreecommitdiff
path: root/docs/users_guide/debugging.rst
diff options
context:
space:
mode:
authorChaitanya Koparkar <ckoparkar@gmail.com>2018-11-29 18:45:07 -0500
committerRyan Scott <ryan.gl.scott@gmail.com>2018-11-29 18:45:19 -0500
commitdcf1f9268f6b338997f2c03891d7bc57da2ee78a (patch)
treeaf97fdc33de5ab91e187636377bf296cff45b095 /docs/users_guide/debugging.rst
parent9e3aaf8b58d0f0e12e2d19b6928b6c2461d58dda (diff)
downloadhaskell-dcf1f9268f6b338997f2c03891d7bc57da2ee78a.tar.gz
Fix #15953 by consistently using dumpIfSet_dyn to print debug output
Summary: In some modules we directly dump the debugging output to STDOUT via 'putLogMsg', 'printInfoForUser' etc. However, if `-ddump-to-file` is enabled, that output should be written to a file. Easily fixed. Certain tests (T3017, Roles3, T12763 etc.) expect part of the output generated by `-ddump-types` to be in 'PprUser' style. However, generally we want all other debugging output to use 'PprDump' style. `traceTcRn` and `traceTcRnForUser` help us accomplish this. This patch also documents some missing flags in the users guide. Reviewers: RyanGlScott, bgamari, hvr Reviewed By: RyanGlScott Subscribers: rwbarton, carter GHC Trac Issues: #15953 Differential Revision: https://phabricator.haskell.org/D5382
Diffstat (limited to 'docs/users_guide/debugging.rst')
-rw-r--r--docs/users_guide/debugging.rst42
1 files changed, 42 insertions, 0 deletions
diff --git a/docs/users_guide/debugging.rst b/docs/users_guide/debugging.rst
index 1ffdf21eba..381bf1809a 100644
--- a/docs/users_guide/debugging.rst
+++ b/docs/users_guide/debugging.rst
@@ -32,6 +32,14 @@ Dumping out compiler intermediate structures
output from :ghc-flag:`-ddump-simpl` will end up in
:file:`{module}.dump-simpl`.
+.. ghc-flag:: -ddump-file-prefix=⟨str⟩
+ :shortdesc: Set the prefix of the filenames used for debugging output.
+ :type: dynamic
+
+ Set the prefix of the filenames used for debugging output. For example,
+ ``-ddump-file-prefix=Foo`` will cause the output from
+ :ghc-flag:`-ddump-simpl` to be dumped to :file:`Foo.dump-simpl`.
+
.. ghc-flag:: -ddump-json
:shortdesc: Dump error messages as JSON documents
:type: dynamic
@@ -575,7 +583,41 @@ These flags dump various bits of information from other backends.
Dump foreign export stubs.
+.. ghc-flag:: -ddump-ticked
+ :shortdesc: Dump the code instrumented by HPC (:ref:`hpc`).
+ :type: dynamic
+
+ Dump the code instrumented by HPC (:ref:`hpc`).
+
+.. ghc-flag:: -ddump-hpc
+ :shortdesc: An alias for :ghc-flag:`-ddump-ticked`.
+ :type: dynamic
+
+ An alias for :ghc-flag:`-ddump-ticked`.
+
+.. ghc-flag:: -ddump-mod-map
+ :shortdesc: Dump the state of the module mapping database.
+ :type: dynamic
+
+ Dump a mapping of modules to where they come from, and how:
+
+ - ``(hidden module)``: Module is hidden, and thus will never be available for
+ import.
+
+ - ``(unusable module)``: Module is unavailable because the package is unusable.
+
+ - ``(hidden package)``: This module is in someone's exported-modules list,
+ but that package is hidden.
+
+ - ``(exposed package)``: Module is available for import.
+
+ - ``(reexport by <PACKAGES>)``: This module is available from a reexport
+ of some set of exposed packages.
+
+ - ``(hidden reexport by <PACKAGES>)``: This module is available from a reexport
+ of some set of hidden packages.
+ - ``(package flag)``: This module export comes from a package flag.
.. _formatting dumps: