Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 358
erszcz Avatar asked Sep 29 '22 23:09

erszcz


1 Answers

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
like image 184
Sibi Avatar answered Nov 15 '22 09:11

Sibi