The most user-friendly way to use the debugger is to run it under Emacs. See the file emacs/README in the distribution for information on how to load the Emacs Lisp files for Caml support.
The Caml debugger is started under Emacs by the command M-x camldebug, with argument the name of the executable file progname to debug. Communication with the debugger takes place in an Emacs buffer named *camldebug-progname*. The editing and history facilities of Shell mode are available for interacting with the debugger.
In addition, Emacs displays the source files containing the current event (the current position in the program execution) and highlights the location of the event. This display is updated synchronously with the debugger action.
The following bindings for the most common debugger commands are available in the *camldebug-progname* buffer:
(command step): execute the program one step forward.
(command backstep): execute the program one step backward.
(command next): execute the program one step forward, skipping over function calls.
(command display): display named value. $n under mouse cursor (support incremental browsing of large data structures).
(command print): print value of identifier at point.
(command display): display value of identifier at point.
(command run): execute the program forward to next breakpoint.
(command reverse): execute the program backward to latest breakpoint.
(command last): go back one step in the command history.
(command backtrace): display backtrace of function calls.
(command finish): run forward till the current function returns.
(command up): select the stack frame below the current frame.
(command down): select the stack frame above the current frame.
In all buffers in Caml editing mode, the following debugger commands are also available:
(command break): set a breakpoint at event closest to point
(command print): print value of identifier at point
(command display): display value of identifier at point