Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ocamldebug support #4229

Open
ejgallego opened this issue Feb 15, 2021 · 8 comments
Open

ocamldebug support #4229

ejgallego opened this issue Feb 15, 2021 · 8 comments
Labels
feature-request User wanted features

Comments

@ejgallego
Copy link
Collaborator

This is an effort to centralize the discussion for a plan to improve ocamldebug support in Dune (c.f. #3818)

Some comments:

  • interface: one possibility would be to add dune debug $byte_file, that would take care of doing the right ocamldebug call, other is to expose variables so the call can be written easily as a rule
  • ocamldebug call: here we need something similar to what dune top and dune utop do, in particular:
    • all the cma files and stubs for $byte_file must be up to date
    • the corresponding -I options have to be passed to ocamldebug so cmi and cma files are built
    • additionally, printers must be loaded; we could use the attributes à la utop, or have an extra field in the (executable ...) stanza as to declare the printers library. The printers could be automatically loaded, but it would be a good idea to actually generate a concrete file to be used with the source command

I think that if we agree on the above, doing a basic rule should be pretty quick.

@ghost
Copy link

ghost commented Feb 15, 2021

Regarding the name, dune debug feels a bit too generic. I'd expect dune debug to be about debugging the build. Perhaps dune ocamldebug or dune ocaml debug.

@ghost
Copy link

ghost commented Feb 15, 2021

BTW, as a programmer what I would really like is being able to write Dune_ocamldebug.break () somewhere in my code and have the execution magically pop-up a debugger halted at this program point.

@ejgallego
Copy link
Collaborator Author

BTW, as a programmer what I would really like is being able to write Dune_ocamldebug.break () somewhere in my code and have the execution magically pop-up a debugger halted at this program point.

That's very interesting, does OCaml support that already? I'm not familiar enough with the internals of the BC interpreter.

@ghost
Copy link

ghost commented Feb 15, 2021

I don't think so. It would probably require some change to ocamldebug

@rgrinberg
Copy link
Member

'd expect dune debug to be about debugging the build. Perhaps dune ocamldebug or dune ocaml debug.

I'd strongly prefer $ dune ocaml debug. Since we can now nest command groups, we should really look for logical ways to group commands.

@progman1
Copy link

progman1 commented Feb 17, 2021

what will happen with a local .ocamldebug?
is there an implicit dependency such that it copies to the build directory?

moreover, could the default executable of the debugger be over-rideable with an
exec from the workspace %{exe:...} ?
and once the custom debugger is no longer part of the workspace be able to
override the default name of ocamldebugger?

@Alizter
Copy link
Collaborator

Alizter commented Apr 27, 2023

@richardlford perhaps this is relevant to your recent work?

@Alizter Alizter added the feature-request User wanted features label Apr 27, 2023
@richardlford
Copy link
Contributor

My PR, #7750, addresses this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request User wanted features
Projects
None yet
Development

No branches or pull requests

5 participants