I spent a full day to read our analysis code, i have to add a lot of ugly print_endline statement in the OCaml code to understand the logic. As a newbee in OCaml, i am stuck at configuring the project to use ocamldebug.
Here is my modified dune file:
(executable
(public_name rescript-editor-analysis)
; (modes byte exe)
(modes byte)
; The main module that will become the binary.
(name Cli)
(flags
(-w "+6+26+27+32+33+39"))
(ocamlc_flags
(:standard "-g"))
; Depends on:
(libraries unix str ext ml jsonlib syntax reanalyze))
Yeah, both me and @cristianoc, who do the bulk of the work with the extension, just use print statements + the tests to work out things. That said, if you get ocamldebug running then that’d be cool to look into too.
Adding breakpoints with using break command, but the entry module name is changed from Cli to Dune__exe__Cli, so if you want to add a breakpoint in the main function, you should use break Dune__exe__Cli.main, this information can be get by running the command ocamlobjinfo /_build/default/src/Cli.bc