A full list of commands and options for ocamldebug is available in the online manual here.
Note: ocamldebug only works on Unix systems and under Cygwin in Windows. The native Windows port of Ocaml will not work in Windows.
The ocamldebug tool can be used to step through the execution points of your program to help debug problems in your source code. To run a program in ocamldebug, you must have compiled it with "ocamlc -g" for it to work.
ocamldebug options:
ocamldebug [options] program [arguments] canopus:~/ta/505/examples/fact> ocamldebug --help -I <dir> Add <dir> to the list of include directories -s <filename> Set the name of the communication socket -c <count> Set max number of checkpoints kept -cd <dir> Change working directory -emacs For running the debugger under emacs -help display this list of options --help display this list of options
Factorial output with ocamldebug:
canopus:~/ta/505/examples/fact> ocamldebug fact 4
Objective Caml Debugger version 3.06 (ocd) run Loading program... done. Factorial of 4 is 24 Time : 61 Program exit. (ocd) kill Kill the program being debugged ? (y or n) y (ocd) quit canopus:~/ta/505/examples/fact>