Impressions on GHC debugger
simonmarhaskell at gmail.com
Thu Apr 19 09:59:43 EDT 2007
Thanks Alexey. I'm working on ironing out all the wrinkles at the moment. Some
of the things you point out, like the prompt, are already on my ToDo list, and
some others I didn't know about, but I'll look into them all in due course.
Alexey Rodriguez Yakushev wrote:
> Yesterday I darcs-got the GHC HEAD to play with the debugger and I have
> the following impressions/bug/suggestions:
> * I would like to know whether I am debugging mode (i.e. in a
> breakpoint) or not. For example
> > *Main> -- normal prompt
> and, for example,
> > *Main: > -- in breakpoint 1
> now, if I evaluate expression "e" via "seq e ()" and it happens to
> trigger breakpoint 2, I would like to see something like
> > *Main:: >
> or some better notation, but you get my point.
> * The notation for printing a list is non-Haskell, consider the
> following evaluated head but unevaluated tail:
> > *Main> :print xs
> > xs = [True | (_t2::[Bool])]
> I would have expected "True : (_t2::[Bool])"
> * Consider the following code:
> > mymap f  = 
> > mymap f (x:xs) = f x:mymap f xs
> > main = mapM_ putStrLn $ mymap ('a':) ["hello","bye"]
> First, I set a breakpoint on line two. When I invoke "main", the
> breakpoint is triggered two times before "main" is done evaluating.
> Afterwards, If I type "main" at the ghci prompt again, the breakpoint is
> not triggered anymore! Even though ":show breaks" lists it.
> * Again considering the code above, if I break at line 2:
> > Stopped at FreeVar2.hs:2:17-19
> > x :: GHC.Base.Unknown
> > f :: t -> a
> > xs :: [GHC.Base.Unknown]
> Now I type "f" and the following message appears:
> > *** Exception: No match in record selector Var.tcTyVarDetails
> * I was wondering whether it would be nice to have a "break"
> function/primitive, so that you can write:
> > mymap f  = 
> > mymap f (x:xs) = (break (f x):mymap f xs)
> with "break" having type "a -> a" and inserting a breakpoint around the
> argument expression. It is handy to not have to recalculate lines.
> However I am not so sure anymore. Using line numbers is not as bad as I
> The debugger is a nice addition to GHC, and I look forward to the
> debugger being integrated into the Emacs Haskell mode!
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.org
More information about the Glasgow-haskell-users