help needed for adding isWHNF primop to 5.00.2

Malcolm Wallace
Wed, 1 Aug 2001 10:31:56 +0100

Andy writes:

> What I want is gdb for GHC :-) Perhaps another build (like profiling vs
> optimizer), and when you press ^C, the ghcdb> prompt comes up :-)

Hey, we already have pretty-much exactly that in nhc98.  :-)

> I wonder if the Cost Center Stack idea can be combined some debugging
> concepts, giving an approximation to a stack dump, and you can
> print (using a non evaluating print) the stack?

Hey, we already have pretty-much exactly that in nhc98.  :-)

The new improved Hat now has several different debugging tools.

    hat-stack		gives a stack dump
    hat-observe		shows some or all actual uses of a function (cf. HOOD)
    hat-detect		automated algorithmic debugging (cf. Freja)
    hat-trail		the classic redex-trails browser (cf. "old" Hat)

There are also "tunnels" between the latter three tools, so you can
for instance jump from a dodgy observation straight into an algorithmic
debugging session starting at the suspicious point.  hat-observe is
about the nearest thing to a gdb I can imagine in a lazy pure setting.

For you ghc junkies out there, yes we are currently developing a
compiler-independent version of Hat which should give you identical
tracing facilities in ghc as in nhc98, at least for the Haskell'98
language.  The port is very much in its early stages though, so if you
want to try the Hat tools out and give us your feedback on whether
they meet your needs, we would prefer that you don't wait for the
compiler-portable version, but recommend using nhc98 for the moment.

I expect to make a new release with some improvements to the tools
within the next couple of weeks.