如何在 ocamldebug 中启动带参数的程序?

How to launch program with arguments in ocamldebug?

我想试试 ocamldebug。我如何 运行 带有一组参数的程序?我在参考文档中找不到任何相关内容。[1]

在 GDB 中,我会输入 run arg1...argn。不幸的是,它似乎在 ocamldebug 中不起作用。

$ ocamldebug server.byte 
    OCaml Debugger version 4.04.0

(ocd) run -i 127.0.0.1 -p 8080
Syntax error.
(ocd)

输入 help run 没有提供太多信息:

(ocd) help run
run: run the program from current position.
  1. https://caml.inria.fr/pub/docs/manual-ocaml/debugger.html

来自文档:

ocamldebug [options] program [arguments]

The arguments following program are optional, and are passed as command-line arguments to the program being debugged. (See also the set arguments command.)

在调试器中,您可以使用 set arguments -i 127.0.0.1 -p 8080 命令。