Skip to content

Using earlybird with Emacs and dap-mode #66

Description

@tmcgilchrist

It would be worth adding documentation for describing how to get earlybird working with dap-mode in Emacs.

Using dap-mode plus dap-ocaml it is possible to start a debugging session. The configuration I have uses use-package and looks like:

; Require dap-mode plus dap-ocaml
(require 'dap-mode)
(require 'dap-ocaml)

; Setup key bindings using use-package.
(use-package dap-mode
  :bind (("C-c M-n" . dap-next)
         ("C-c M-s" . dap-step-in)
         ("C-c M-a" . dap-step-out)
         ("C-c M-w" . dap-continue)))

Then you need to create the correct launch.json which is not automated at the moment. I've been manually creating files like so (swapping in the program name as necessary):

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "OCaml earlybird (experimental)",
            "type": "ocaml.earlybird",
            "request": "launch",
            "program": "./_build/default/fib.bc",
            "stopOnEntry": true,
            "cwd": "${workspaceFolder}"
        },
    ]
}

I posted my setup here https://lambdafoo.com/posts/2024-03-25-ocaml-debugging-with-emacs.html

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions