Neovim for Beginners — Terminal Debugger
In this article, we will learn how to use the built-in terminal debugging plugin to debug Rust applications with gdb
and rust-gdb
.
This article is part of the Neovim for Beginners series.
The Neovim configuration files can be found in this repository.
Getting Started
The terminal debugging plugin (:h terminal-debug
) can be used to debug a program with gdb
and view the source code in a Vim window. This is completely contained inside Vim and also works remotely over an ssh connection.
This plugin needs to be loaded explicitly using the following command.
:packadd termdebug
Alternatively, we can load the plugin when we start Neovim.
gdb
Depending on the operating system, the GNU debugger can be installed easily.
For macOS, if you encounter the following error, refer to this link to give gdb
permission to control other processes.
Starting program: /x/y/foo
Unable to find Mach task port for process-id 28885: (os/kern) failure (0x5).
(please check gdb is codesigned - see taskgated(8))