ocamldebug

Command line arguments to ocamldebug

一笑奈何 提交于 2019-12-25 04:26:08
问题 How can I pass command line arguments to ocaml debugger? I am looking for something similar to gdbs --args , or r ... , or params ... < . For example, after compiling open Printf;; let () = for i = 0 to Array.length Sys.argv - 1 do printf "[%i] %s\n" i Sys.argv.(i) done;; is there a way to step through the executable? 回答1: I found it, after starting the debugger, you have to set the arguments, eg (ocd) set arguments "a" "b" "C" (ocd) r 来源: https://stackoverflow.com/questions/41128840/command