debuggingocamlocamldebug

Command line arguments to ocamldebug


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?


Solution

  • I found it, after starting the debugger, you have to set the arguments, eg

    (ocd) set arguments "a" "b" "C"
    (ocd) r