About using the debuggers #16
mortang2410
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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