GHCi debugger status

Simon Marlow marlowsd at
Mon Dec 1 04:15:07 EST 2008

Isaac Dupree wrote:
> Simon Marlow wrote:
>> Claus Reinke wrote:
>>> Then how about my suggestion for selectively adding lexical scope to
>>> breakpoints? I'd like to be able to say
>>>    :break <loc/name> {names}
>>> and have GHCi make the necessary changes to keep {names} available
>>> for inspection when it hits that breakpoint. 
>> The only easy way to do that is to recompile the module that contains 
>> the breakpoint.  To do it without recompiling is about as hard as 
>> doing what I suggested above, because it involves a similar mechanism 
>> (being able to selectively retain the values of free variables).
> sure, but GHCi recompiling the module maybe takes less than a second, 
> whereas going and modifying the source-code in an editor takes orders of 
> magnitude more time!  Is there something fundamentally wrong with 
> recompiling an interpreted module?

One problem with recompiling is that you lose any execution context - 
normally you can set new breakpoints during execution, but recompiling 
would force you to start the debugging session again.  Also any bindings 
made on the command-line will be lost.

However, I agree, recompiling is still better than nothing.


More information about the Glasgow-haskell-users mailing list