https://github.com/svaante/dape#

Given that eglot has been part of the core emacs, I believe this is a long lasting wish for a lot of emacsers that has finally been fulfilled. (a stand alone DAP implementation that does not rely on LSP-mode)

  • svaante@alien.topB
    link
    fedilink
    English
    arrow-up
    1
    ·
    11 months ago

    Expect to debug the dape debugger

    Did you use the debugpy adapter with the following configuration from the readme? (add-to-list 'dape-configs `(debugpy modes (python-ts-mode python-mode) command “python3” command-args (“-m” “debugpy.adapter”) :type “executable” :request “launch” :cwd dape-cwd-fn :program dape-find-file-buffer-default))

    I have tested this quite often at my day job so I am a bit surprised you bumped into issues. But thats not to say that Dape will contain warts until there is enough feedback and testing. It would be great if you could dump the contents of the dape-debug buffer into an issue on github!

    DAP has some issues as well, extremely loose specification, the overwhelming majority is tested with vscode and a lot of cruff is hidden inside in the plugins for vscode. I was close to putting it in the bin at several points.

    Other problems I’ve encountered is a weird way that it stores configuration options once you’ve told dape to connect to stuff. The UX around that needs work before it’s plug-and-play.

    Usability feedback is appreciated, the dape command tries to do a lot of stuff, maybe to much.

    It models the way one would use a command line tool. For example if we run dape debugpy it executes the configuration above with all of the plist entries as the default command line arguments. If we want to overwrite any “argument” or add an “argument”, lets say we wanted to run the python file with some enviroment variable then call dape with debugpy :env (:ENV “MY_ENV”).

    The other part is actually evaluating all of the symbols and functions in the config and adds the result into history for ease of access.

    Being able to see all the relevant variables, a la the GDB multi-window support in Emacs, is also nice. Which makes me wonder why we can’t just reuse that, as there’s surely man-years of work to make that stable and effective.

    I am regretting not looking into this when I started, even though I kinda like having one “big” buffer with all of the information, using the tried and true GUD interface would meld better with one of the goals of package of being closer to emacs. So I am looking into the possibilities.

    Still, an impressive effort, and I’m surprised how little code dape actually is. I’m sure it’ll improve quickly once people start giving feedback.

    Thank you, it would not have been possible for me to get this far without Wireshark. A little reverse engineering is always fun :) And thanks for your feedback!

    • FreeAd7233@alien.topOPB
      link
      fedilink
      English
      arrow-up
      1
      ·
      11 months ago

      I just tried the example configuration (for python) from github and the dap works perfectly fine to me, everything works as expected except the only one thing: post-run cleanup.

      I do notice that there are some leak problems: the debugpy process will not exit even when the debug session terminated, keeping high CPU usage even after emacs exits.

      It is a tricky problem and not easily reproduce, I will try to dive into this problem more to make it as reproducible as possible.

      Besides, the go debugger (delve) works perfectly to me with the example configuration.

    • mickeyp@alien.topB
      link
      fedilink
      English
      arrow-up
      1
      ·
      11 months ago

      Did you use the debugpy adapter with the following configuration from the readme?

      Of course.

      DAP has some issues as well, extremely loose specification, the overwhelming majority is tested with vscode and a lot of cruff is hidden inside in the plugins for vscode. I was close to putting it in the bin at several points.

      Yes, indeed.