Debugger integration with a focus on ease-of-use.
Note: This project is no longer actively maintained. See this comment for details.
This plugin provides LLDB debugger integration for Neovim (demo gif) featuring:
This plugin started out as a fork of https://github.com/gilligan/vim-lldb which was forked from http://llvm.org/svn/llvm-project/lldb/trunk/utils/vim-lldb/
This plugin takes advantage of Neovim's job API to spawn a separate process and communicates with the Neovim process using RPC calls.
Using a plugin manager such as vim-plug:
Plug 'dbgx/lldb.nvim'
Alternatively, clone this repo, and add the following line to your nvimrc:
set rtp+=/path/to/lldb.nvim
Execute:
:UpdateRemotePlugins
and restart Neovim.
The plugin is being developed keeping 3 broad goals in mind:
Here is a short screencast demonstrating the basics: Youtube
Also check out the getting started section from vim-docs (:h lldb-start
).
For easy navigation of docs, I suggest using viewdoc plugin by powerman.
You have 2 choices:
:UpdateRemotePlugins
, and restart Neovim.test/run.sh
, and see how it goes.
If you encounter an error during import lldb
, see #6 (comment).Please file a bug report (also see :help lldb-bugs
) if the problem persists.
rustc -g <file>
)go build -gcflag '-N -l' <file>
, see this article's conclusion)Try clang instead of gcc (fingers crossed). See clang comparison:
Clang does not implicitly simplify code as it parses it like GCC does. Doing so causes many problems for source analysis tools.
To be able to attach, the "attacher" needs to have special permissions. The easiest method is to run a debug server as 'sudo' and connect to it. See the question below.
I haven't been able to get gdbserver
, lldb-gdbserver
or lldb-server gdbserver
to work properly with the python API. But the following works; run:
# use sudo if you want to attach to a running process
$ lldb-server platform --listen localhost:2345
# in older versions of lldb, use this instead
$ lldb-platform --listen localhost:2345
The above command will start the server in platform mode and listen for connections on port 2345. Now, from the client (the plugin), run:
(lldb) platform select remote-linux
(lldb) platform connect connect://localhost:2345
(lldb) process attach --name cat
For more info on this, see Remote Debugging.