[Haskell-cafe] Debugging with gdb?

Max Bolingbroke batterseapower at hotmail.com
Wed Apr 13 09:27:15 CEST 2011


On 13 April 2011 07:59, Svante Signell <svante.signell at telia.com> wrote:
> As I don't know anything about Haskell, can I make a stupid question: Is
> there any method to create debug symbols for a Haskell program, and is
> it possible to debug with gdb?

You cannot create debug symbols. Things that are possible:

 1. You may use the -debug flag to GHC to link with the debug RTS,
which has full debugging information for GDB. Note that this only lets
you debug the *RTS*, not any of the code you wrote

 2. Use GDB to debug your Haskell code without giving it any symbols
or understanding of the Haskell calling conventions. This is very
difficult. Information on this is on the GHC wiki:
http://hackage.haskell.org/trac/ghc/wiki/Debugging/CompiledCode?redirectedfrom=DebuggingGhcCrashes

 3. Use the GHCi debugger, which does actually work surprisingly well:
http://www.haskell.org/ghc/docs/7.0.3/html/users_guide/ghci-debugger.html

Cheers,
Max



More information about the Haskell-Cafe mailing list