Is there a tracing debugger like `dbg` available for Haskell or OCaml?

280 views Asked by At

Is there a tracing debugger like dbg available for Haskell or OCaml?

Very informally, it's printf-style debugging only better, completely configurable at runtime. In essence, the user can register a trace handler when a system is running, which will be called on each action from a set of actions supported by the runtime (e.g. on each function call/return, on each message sent/received etc.). Such a handler may log every operation, which gives a nice sequence of all the steps happening in (part of) the system.

This mechanism can be used for logging/debugging, profiling certain parts of the system, but in many cases just for discovering how a new (unknown to the programmer) system works.

1

There are 1 answers

3
Sibi On

For Haskell, GHCi provides a simple imperative style debugger. Look it's documentation to find more details about it. Some of its feature are

  • Ability to set a breakpoint
  • Stepping through execution
  • Inspecting local variables
  • Treating Exceptions as breakpoints
  • Typing in any code to execute it immediately