3

For a school project, I'm using Jane Street's Core and Async libraries. I'm trying to debug a problem with a bind Unix syscall, so I run ocamldebug myprogram. This stops when the exception is raised (Unix.Unix_error), but upon backstepping I get the following message:

No source file for Async_parallel.Master_process.

which is the file in which the error is raised. Is it possible to specify to opam to build the packages I install with debugging information, so that I can use ocamldebug to examine them? Otherwise, what else can I do to get around this problem?

Thanks in advance!

Miles Yucht
  • 538
  • 5
  • 12

1 Answers1

3

Since 4.01 ocaml compilers will use the OCAMLPARAM environment variable to enable certain options. Try running with OCAMLPARAM="_,g" opam install .... Also see https://github.com/ocaml/opam/issues/681

On the other hand debugging this kind of problems is much easier and effective with strace -e bind -f -ttT ./myprogram. Also Unix_error carries the reason of the error, don't disregard it.

ygrek
  • 6,656
  • 22
  • 29
  • I can't find any documentation on the `OCAMLPARAM` variable. Do you have any links? – Antoine Jul 09 '15 at 12:43
  • I guess it is still experimental, use at your own risk - https://github.com/ocaml/ocaml/blob/4.02.2/driver/compenv.ml#L144 – ygrek Jul 09 '15 at 18:46