Open holyfight6 opened 3 years ago
Any updates on this issue? I just started experiencing the same bug.
I recently started using an M1 Mac, only to discover that gdb
cannot yet be compiled on Apple Silicon, so I decided to give lldb
a try. While I can use both regular lldb
and rust-lldb
to debug my Rust program from the terminal just fine, using M-x lsp-rust-analyzer-debug
yields the exact same results described above.
I also tried to use a custom debug template setting :MIMode "lldb"
and :miDebuggerPath
appropriately, which got me the same results above with lldb exiting with error: unknown option: --interpreter=mi
.
I was able to make it work using the following (for doom emacs). I had run dap-cpptools-setup
beforehand.
(setq lsp-rust-analyzer-debug-lens-extra-dap-args
`(:MIMode "lldb"
:miDebuggerPath ,(f-join doom-local-dir "etc/dap-extension/vscode/cpptools/extension/debugAdapters/lldb-mi/bin/lldb-mi")
:stopAtEntry t
:externalConsole
:json-false))
So it sounds more like something to document, what do you think @zeronone?
@yyoncho Yep agree!
Although a bit old thread, but I have solved this issue finally on my M1 MacBook following the steps here
lldb-mi
in your system, I used the one already installed which comes with vscode
in the following path.~/.vscode/extensions/ms-vscode.cpptools-1.15.4-darwin-arm64/debugAdapters/lldb-mi/bin/lldb-mi
chmod +x /bin/lldb-mi
in the path abovezshrc
usingexport PATH="$PATH:$HOME/.vscode/extensions/ms-vscode.cpptools-1.15.4-darwin-arm64/debugAdapters/lldb-mi/bin"
lldb-mi
working.╰─ lldb-mi --version
Version: GNU gdb (GDB) 7.4
(This is a MI stub on top of LLDB and not GDB)
All rights reserved.
dap-mode
and when you start debugging you can create a template file as
(dap-register-debug-template
"LLDB::Run"
(list :type "lldb-mi"
:request "launch"
:name "LLDB::Run"
:target nil
:cwd nil
))
Thank you for the bug report
lsp-mode
related packages.where
lsp-start-plain.el
can be downloaded here. Alternatively, it will be great if you can reproduce the issue using lsp-docker which provides the minimal configurations forlsp-mode
and ships with most of the language servers.Bug description
I don't have gdb installed on my machine, when I try to use
lsp-rust-analyzer-debug
or the debug lens, the following error occurred:Warning (emacs): Initialize request failed: Unable to start debugging. Launch options string provided by the project system is invalid. Unable to determine path to debugger. Please specify the "MIDebuggerPath" option.
After modified the source code to:(list :type "cppdbg" :request "launch" :name label :args executable-args :cwd workspace-root? :sourceLanguages ["rust"] :MIMode "lldb" :MIDebuggerPath "/usr/bin/lldb" :program)
, lldb will exit with errorerror: unknown option: --interpreter=mi error: unknown option: --tty=/dev/pts/0 Use 'lldb --help' for a complete list of options.
. And after I installed gdb without settingMIMode
orMIDebuggerPath
, these error have gone.Steps to reproduce
M-x lsp-rust-analyzer-debug
or click the debug lens in any rust project without gdb installed.Expected behavior
The
lsp-rust-analyzer-debug
should output some error when default debugger isn't installed, it should also support lldb, and there should be a way to set theMIMode
andMIDebuggerPath
options.Which Language Server did you use?
rust-analyzer
OS
Linux
Error callstack
No response
Anything else?
In the rust-analyzer vscode extension, I found that it support both
{ "vadimcn.vscode-lldb": getLldbDebugConfig, "ms-vscode.cpptools": getCppvsDebugConfig };
as available debug engines, it will be great if we can choose from these engines too.