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

lsp-rust: Allow debugging with GDB 14. #4444

Merged
merged 1 commit into from
Apr 28, 2024
Merged

Conversation

daym
Copy link
Contributor

@daym daym commented Apr 27, 2024

Since GDB 14 now supports DAP natively, we can also just use GDB instead of vscode-cpptools. Try that in lsp-rust.

See also emacs-lsp/dap-mode#790, which is required.

@github-actions github-actions bot added rust client One or more of lsp-mode language clients labels Apr 27, 2024
@@ -1541,7 +1541,7 @@ and run a compilation"
(`() (user-error "No compilation artifacts or obtaining the runnable artifacts failed"))
(`(,spec) spec)
(_ (user-error "Multiple compilation artifacts are not supported")))))
(list :type "cppdbg"
(list :type (if (featurep 'dap-gdb) "gdb" "cppdbg")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is gdb preferred over cppdb? 🤔

Copy link
Contributor Author

@daym daym Apr 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I understand it:

If the user doesn't do (require 'dap-gdb) in their emacs config file then dap-gdb.el won't be used anyway (even though the file is on disk), right?

So this way should be backward compatible with whatever users have configured now.

On the other hand, if someone adds (require 'dap-gdb) to their emacs config now then lsp-rust will switch over to gdb.

I didn't think of more use cases than that yet.

The only reason I do the (featurep 'dap-gdb) is because I just touched it so I'm very sure it works.

Long term, this entire spot could use some automatic "which debugger features are there, which will actually work, and of those, which one should we prefer for the default debugger profile" policy--but I don't know whether we want that and when and whether it already exists.

@yyoncho yyoncho merged commit ab8ce86 into emacs-lsp:master Apr 28, 2024
8 of 14 checks passed
@daym daym deleted the gdb-14 branch May 3, 2024 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client One or more of lsp-mode language clients rust
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants