Experimental Leksah GHCi Debugger

Hamish Mackenzie hamish at firestream.co.uk
Tue Apr 14 02:17:59 EDT 2009


We have pushed a patch that adds debugging to Leksah by controlling a
GHCi process.  Please, if you have time, try it out and let us know
how you get on.

It is in leksah-head only at this stage...
    darcs get http://code.haskell.org/leksah-head

__Important Notes__

Please add -ferror-spans to your ghc options as it is now supported
and gives better error locations.  Remember to take it out if you go
back to the release version of leksah.

You will need to "runhaskell Setup install" to get the new
Default.menu file.  I the Default.menu may be backwards compatible,
but if not just run install on the old version of leksah if you go
back.

Package Build and Package Run are mapped to :reload and :main while
the debugger is running.

:module is not in the menu (select some text random text and choose
Set Breakpoint)

If we have left something out of the menus then you can always create
a new file and type you commands in and use the Execute Selection menu
item.

__Some of the Features__

    * Set Breakpoints at current cursor location or on selected expression
    * Breakpoints highlighted in yellow
    * Clicking on breakpoints and contexts in the log takes you to
them in the code
    * Last context is highlighted in pink
    * Background build uses :reload while in the debugger
    * Log window is a bit more colourful (info only entries are in grey)
    * Works out the flags for running GHCi by passing a
--with-ghc=echo (actually I had to add a leksahecho executable so that
it will work on windows)

__Known Issues__

    * No docs (other than what is written here)
    * No keyboard shortcuts.  You can add them to your keymap (let us
know what you choose as we need good defaults)
    * Modules are not automatically loaded as interpreted except when
setting breakpoints (do a clean and configure before you start the
debugger and it should load all your modules as interpreted)
    * Errors sometimes show up in the next operation's output. (stderr
and stdout are not synced).
    * The debug mode toggle button on the toolbar has the same icon as
the background build (debug is the one on the right)
    * The debug mode toggle button does not always show the correct
state (unless it was used to start or stop GHCi it does not change)
    * If your package contains mare than one executables then the
first one is the one that is loaded in the debugger.
    * Debug Stop (perhaps should be called Debug Break) does not work
properly in windows, in fact it closes leksah. I think this is because
the child process is not created with the CREATE_NEW_PROCESS_GROUP
flag.  We may need to write our own runIntercativeProcess to fix this.



More information about the Leksah mailing list