About using the debuggers #16
Replies: 1 comment
-
|
Yeah, I've never gotten debugging to work. Thanks for looking into this, even though I wasn't quite able to get it to work for me. I am using eglot. I didn't know it was incompatible with dap. Or is it dape? This probably won't help anyone, but what I've done for Python:
deepwiki actually said that you need to create an adapter file in Actually, deepwiki gave several examples of debug adapters for Python, one for single file scripts, one for modules, etc. I felt like it might be hallucinating/confabulating, so I came here! This is free software, so I don't want to sound like I'm making demands, but it really would be nice to have some better documentation for the debugger in Doom. Unfortunately, those that are qualified probably don't have time, and the rest of us... are just not qualified. 😄 Maybe some Emacs guru will be kind enough to chime in sometime down the line. 😄 edit: edit2: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi. I am new to Doom Emacs, though I had used Emacs beore years ago. I see that using the various debuggers in Doom Emacs is somewhat confusing (at least for me I suppose). The included documentation for
:tools debuggeris rather sparse with unwritten parts. It mentions bothdap-modeandDAPE, which are two different things. So I am sharing some of what I have figured out through trial and error, and I hope people could tell me whatever I get wrong. More tips would also be appreciated. Hopefully it will help others, and the documentation will be filled out soon.debug-on-entryfor a function to debug and then run/eval any elisp expression. Unfortunately debugger doesn't correspond with source (edebug uses source). Also don't turn on debugger mode on the source file (it is for the debugger backtrace buffer). In the debugger backtrace buffer, pressdorjto continue. We canbacktrace-toggle-localsto show locals of a specific function / context. For some limited symbols we can usebacktrace-help-follow-symbolto jump to source.edebug-instrument-defun-onfor functions you want to monitor. Then run/eval any expression withgR. edebug works like debug above, but also shows which line of code in the source you're on. Pressnin the source file to make one more step. Pressdin the source file to see backtrace buffer, wherebacktrace-toggle-localsalso works. Pressqin source file to quit edebug.+lsp ::is a deprecated flag along withdap-modeanddap-ui, and that it requires:tools lsp(not compatible with Eglot). I am not sure what this means, but I suspect thatdap-modeanddap-uishould no longer be used. And the:tools debuggerperhaps used to be:tools debugger + lsp(but is no longer). Nowadays we enable bothdebuggerandlspunder:toolsininit.el.lsp-mode. Only one can be active at a time for any programming language. Check doom docs for each language to see how to choose which with flags.dapewithM-xin a C file, and you will be asked for the "adapter" command. Example: assuming the compile command iscc -g main.c -o main.out(output with debug symbols), a correctly formatted adapter command islldb-dap :program "/Users/John/programming/C_testing/main.out" :cwd "/Users/John/programming/C_testing/"where you provide the correct :program and :cwd (current working directory). Remember to set breakpoints withdape-breakpoint-toggle.Beta Was this translation helpful? Give feedback.
All reactions