ocamlocamldebug

How to launch program with arguments in ocamldebug?


I want to give ocamldebug a try. How can I run a program in it with a set of arguments? I can't find anything related in the reference documentation.[1]

In GDB, I would enter run arg1...argn. Unfortunately it doesn't seem to work in ocamldebug.

$ ocamldebug server.byte 
    OCaml Debugger version 4.04.0

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

Entering help run doesn't give much information:

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

Solution

  • From docs:

    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.)

    In debugger, you can use set arguments -i 127.0.0.1 -p 8080 command.