I am wondering if it is possible to debug/execute a Ocaml program step by step, for instance like debugging C++ programs in Visual Studio. In other words, I would like to run a Ocaml program line by line, also it would be great if we could "watch" the value of some variables.
By the way, I am using Emacs as editor.
Could anyone help? Thank you very much
Edit-1: As sepp2k suggested, I am trying to run camldebug under Emacs. I have a problem in the beginning: the web page mentions "The Caml debugger is started under Emacs by the command M-x camldebug
, with argument the name of the executable file progname
to debug." Actually I have only 3 choices:
M-x camldebug
M-x camldebug-mode
M-x ca开发者_运维问答mldebug-step
Edit-2: When I type M-x camldebug
, enter, it shows Symbol's value as variable is void: caml-mode-map
which does not allow me to enter the executable file.
Could anyone help? Thank you!
You can step through the code using the debugger ocamldebug, which can be run in emacs.
The documentation is telling you to supply the executable file's name to camldebug
. You can do this by M-x camldebug
, then press enter, and then type in the path of the executable when emacs prompts you for it.
精彩评论