Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with setupCommands and REPL in dap-mode #812

Open
piratkin opened this issue Oct 18, 2024 · 1 comment
Open

Problems with setupCommands and REPL in dap-mode #812

piratkin opened this issue Oct 18, 2024 · 1 comment

Comments

@piratkin
Copy link

I am configuring debugging using dap-mode in Emacs, and here is my configuration:

(use-package! dap-cpptools
  :ensure t
  :config
  (dap-cpptools-setup))

(use-package! dap-ui
  :hook
  (dap-mode . dap-ui-mode)
  :config
  (setq
   dap-ui-controls-mode nil
   dap-ui-many-windows-mode nil))

(use-package! dap-mode
  :ensure t
  :hook
  (prog-mode . dap-mode)
  :config
  (setq
   dap-auto-configure-features
   '(locals sessions repl)
   dap-ui-mode 1))

(dap-register-debug-template 
  "cpptools::launch" 
  '(:type "cppdbg" 
    :request "launch" 
    :name "cpptools::launch" 
    :program "<...>" 
    :cwd "." 
    :MIMode "gdb" 
    :miDebuggerPath "gdb"
    ;; :stopAtEntry t  
    :setupCommands 
    [(:description "test" 
      :text "break main" 
      :ignoreFailures nil)])) 

I set the breakpoint in the setupCommands (i.e., break main) solely to test the setupCommands parameter. However, when I start the debugger, it does not appear to be executing the commands in setupCommands. Additionally, I have noticed that the REPL is not functioning properly, as shown in the output below:

*** Welcome to Dap-Ui ***
>> n
-var-create: unable to create variable object
>> s
-var-create: unable to create variable object
>> q
-var-create: unable to create variable object
>> r
-var-create: unable to create variable object
>> 

Here is the version of Emacs I am using:

$ emacs --version
GNU Emacs 30.0.91
Development version 9a1c76bf7ff4 on HEAD branch; build date 2024-10-14.
Copyright (C) 2024 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
I am using the Doom Emacs configuration with the following relevant packages:

I would like to clarify whether the setupCommands parameter is supported in this context. Additionally, having full access to the debugger using the REPL during debugging is very useful in certain situations, and I would appreciate any guidance on resolving these issues.

Thank you for your help!

@piratkin
Copy link
Author

I observe the same behavior in VS Code:

image

It seems likely that the issue is related to the OpenDebugAD7 adapter itself.

I also downgraded to the stable version of GNU Emacs 29.4, but nothing has changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant