Tracking and debugging in OCaml

What do you use for tracking and debugging in OCaml?

For debugging, I tried ocamldebug and the Emacs plugin.

For tracing, I want to be able to print a data constructor for each variable. An example using Camlp4 is shown here: http://caml.inria.fr/pub/docs/tutorial-camlp4/tutorial007.html#toc52

type colour = Red | Green | Blue let print_colour = function Red -> print_string "Red" | Green -> print_string "Green" | Blue -> print_string "Blue" 
+8
debugging ocaml tracing
source share
1 answer

ocamldebug works great when you can use bytecode.

If you want to debug an application with internal code, there is a patch from Thomas gazagnaire from Mantis, which allows you to step-by-step into the OCaml program using gdb. Parts of this patch should be integrated into the next version of OCaml (3.13 or 4.00).

Currently, however, it is not possible to print OCaml values, but another patch appears, using GADT to determine the general printer function for any type.

+9
source share

All Articles