[ANN] earlybird 1.2.0 – revival of a debugger

Hi, everyone!

The lacking state of OCaml debuggers has been a rather hot topic recently, so I’m particularly excited to announce the release of earlybird 1.2.0.

Many of you might be familiar with OCaml earlybird: a debugger which supports Debug Adapter Protocol, allowing it to be used directly from VS Code’s builtin debugging GUI (among possibly other IDEs). This phenomenal tool was developed by @hackwaly.

Unfortunately, for a long time it wasn’t updated to support newer versions of OCaml and fell into despair. Since there’s still (or even moreso) need for OCaml debugging tools, it would be a real shame if earlybird was dead forever. Therefore, recently I volunteered to pick up its maintenance and get it up and running again.

I’m hereby announcing the release of earlybird 1.2.0 which supports OCaml 4.12, 4.13, 4.14 and 5.0. Moreover, I extended the VS Code OCaml Platform extension (since version 1.13) to directly be able to launch earlybird: GitHub - ocamllabs/vscode-ocaml-platform: Visual Studio Code extension for OCaml. This brings the handling of a DAP for OCaml into the same extension which handles the LSP for OCaml. Instructions are available at the above link!

Note that the OCaml Platform integration is still experimental. I invite everyone to try out the new release of earlybird via the new VS Code integration. The main purpose of this announcement is to get real-world testing for both sides and hopefully also get more people interested/involved.

Beware that this revival of earlybird comes purely out of my free time, so don’t expect any big developments now. So far I did what I could to get earlybird reasonably working again and I’ll do my best to keep it from degrading. I think it’s still valuable to have earlybird in the ecosystem until maybe something better comes along. However, if working on earlybird sparks anyone’s interest, I’ll gladly accept bug fixes and improvements, all towards a better OCaml ecosystem.


A final note about earlybird: it uses the (undocumented) protocol of ocamldebug to communicate with a bytecode executable. Thus, it comes with all the limitations that ocamldebug and its protocol have.
Notably, don’t get too excited about OCaml 5.0 support: debugging is supported only until a domain is spawned (https://github.com/ocaml/ocaml/pull/11065#pullrequestreview-975383464).

53 Likes

I followed the tutorial at GitHub - ocamllabs/vscode-ocaml-platform: Visual Studio Code extension for OCaml and managed to get ocamlearlybird up and running. However, I cannot figure out how to pass commandline arguments to the program being debugged. I tried adding the “args” property to the launch.json configuration file, to no avail. In fact, there was a hover text which informed me that “Property args is not allowed”.

I also tried adding the arguments directly after the program executable in the “program” property of the configuration. That caused a “Unix.Unix_error” when launching the debug. That seemed to be an error in parsing the config json.

Using arguments property instead of args should work.

1 Like

Ah, thanks a lot! Is there some place that documents all such options supported by the config json?

Not in an user-friendly way. But they’re defined in VS Code OCaml Platform extension metadata: vscode-ocaml-platform/package.json at 2f63a8915a423f7086d041e7df94bf6bf2d1845a · ocamllabs/vscode-ocaml-platform · GitHub.
Code completion in launch.json should also suggest them.

1 Like

Can not set breakpoints for dune build bc executable file in vscode.
issue