Skip to content

Using earlybird with Emacs and dap-mode #66

@tmcgilchrist

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions