How to use `trace` while debuging GHC

Michal Terepeta michal.terepeta at gmail.com
Mon Nov 12 10:09:58 CET 2012


On Mon, Nov 12, 2012 at 5:15 AM, Richard Eisenberg <eir at cis.upenn.edu>
wrote:
>
> I've recently used the conveniently-typed (pprTrace :: String -> SDoc ->
a -> a) for this purpose. You have to compile with -DDEBUG, but it works
great.
>
> Richard

To use pprTrace you don't actually need to compile with -DDEBUG, it only
checks if -dno-debug-output has been specified on the command line:
http://www.haskell.org/ghc/docs/latest/html/libraries/ghc/src/Outputable.html#pprTrace
http://www.haskell.org/ghc/docs/latest/html/libraries/ghc/src/StaticFlags.html#opt_NoDebugOutput

Cheers,
Michal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20121112/725be89e/attachment.htm>


More information about the Glasgow-haskell-users mailing list