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-line-arguments-to-ocamldebug

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!