Hello, dear friends!
Just recently, hackwaly has added ocaml debugging support through ocamlearlybird for ocaml version 4.11.1 and it is available in Visual Studio Code.
If one follows his example (“ Debug utop ” here: GitHub - hackwaly/ocamlearlybird: OCaml debug adapter), it can be seen that this new approach is different from the old one, described here:
Before, we would compile main.ml ocamlc -g src/main.ml,
then set breakpoints in main.ml and run “OCaml Debug” from the VS Code Debug panel.
Now, we compile main.ml using dune toolchain and then select context menu “Start an OCaml Debug Session” on bytecode file (main.bc) in vscode explorer to quickly start a debug session.
And now it is all done in utop enviroment unlike the old way where we just executed ./main in a terminal.
Could somebody explain what is the idea behind the new approach and how is it different from the old one.
Thanks in advance!