-
Notifications
You must be signed in to change notification settings - Fork 470
Byte target can't be debugged with ocamldebug #4347
Copy link
Copy link
Open
Description
Expected Behavior
dune build should produce a byte target for https://github.com/disposedtrolley/hello_ocaml which is able to be debugged with ocamldebug. A breakpoint should be able to be set on line 2 of the helloworld module.
Actual Behavior
While dune build is able to build a .bc file, it seems to be missing debug symbols. For example, attempting to set a breakpoint on line 2 of helloworld.ml results in:
hello_ocaml · (main) ⟩ ocamldebug _build/default/helloworld.bc ~/p/o/hello_ocaml 2
OCaml Debugger version 4.12.0
(ocd) break @helloworld 2
Loading program... done.
Can't find any event there.
(ocd)
When the project is built with ocamlc -g helloworld.ml, the resulting a.out file can be debugged with ocamldebug correctly.
Reproduction
- PR with a reproducing test:
- Clone https://github.com/disposedtrolley/hello_ocaml
- Run
dune build - Run
ocamldebug _build/default/helloworld.bc - Type
break @helloworld 2 - Observe that the debugger outputs "Can't find any event there."
Specifications
- Version of
dune(output ofdune --version): 2.8.4 - Version of
ocaml(output ofocamlc --version) 4.12.0 - Operating system (distribution and version): Fedora 33 (x86), macOS 11.2 (arm64)
Additional information
I've tried this with OCaml 4.12 (on macOS with Apple Silicon) and 4.10.2 (on macOS with Apple Silicon and Fedora 33 x86).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels