Proper IDE and debugger for OCaml4 project

Also, what debugger with breakpoints and variables values might I use for that project?

Use GDB for the debugger, it’s typically better supported on older releases. I just checked on my Ubuntu ARM64 machine, setting breakpoints based on mangled names and tab completion works. Setting breakpoints using file and line numbers doesn’t appear to work. For printing values use the gdb macros from that release ocaml/tools/gdb-macros at 4.07.1 · ocaml/ocaml · GitHub

GDB works with DAP under VSCode, set it up with GDB as you would for a C or Rust project. I have this launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "gdb",
            "request": "launch",
            "name": "Debug",
            "program": "${workspaceFolder}/_build/default/bin/dump_trace.exe",
            "args": ["ocamlopt.ctf"],
            "cwd": "${workspaceFolder}"
        }
    ]
}
2 Likes