Neovim thin wrapper for GDB, LLDB and PDB
Switch branches/tags
Nothing to show
Clone or download
Latest commit 8ec1ceb Nov 20, 2018

README.md

Branch Status Description
master Travis Build Status Modern version implemented in Moonscript and some VimL
legacy Travis Build Status The original version mostly in VimL and some Python

GDB for neovim

Gdb, LLDB and PDB integration with NeoVim.

Table of contents

Overview

Taken from the neovim: neovim_gdb.vim

It is instantly usable: type <leader>dd, edit GDB launching command, hit <cr>. Or type <leader>dl to do the same with LLDB backend. Or type <leader>dp to start debugging a python program.

nvim-gdb

nvim-gdb + llvm

Installation

Check the prerequisites in the script test/prerequisites.sh.

If you use vim-plug, add the following line to your vimrc file for the mainstream version:

Plug 'sakhnik/nvim-gdb', { 'do': './install.sh' }

or for the original VimL version:

Plug 'sakhnik/nvim-gdb', { 'branch': 'legacy' }

You can use any other plugin manager too:

  • vundle
  • neobundle
  • pathogen

Options

To disable the plugin

let g:loaded_nvimgdb = 1

The behaviour of the plugin can be tuned by defining specific variables. For instance, you could overload some command keymaps:

let g:nvimgdb_config_override = {
  \ 'key_next': 'n',
  \ 'key_step': 's',
  \ 'key_finish': 'f',
  \ 'key_continue': 'c',
  \ 'key_until': 'u',
  \ 'key_breakpoint': 'b',
  \ }

Likewise, you could define your own hooks to be called when the source window is entered and left. Please refer to the online NeoVim help: :help nvimgdb.

Usage

See :help nvimgdb for the complete online documentation. Most notable commands:

Mapping Command Description
<Leader>dd :GdbStart gdb -q ./a.out Start debugging session, allows editing the launching command
<Leader>dl :GdbStartLLDB lldb ./a.out Start debugging session, allows editing the launching command
<Leader>dp :GdbStartPDB python -m pdb main.py Start Python debugging session, allows editing the launching command
<F8> :GdbBreakpointToggle Toggle breakpoint in the coursor line
<F4> :GdbUntil Continue execution until a given line (until in gdb)
<F5> :GdbContinue Continue execution (continue in gdb)
<F10> :GdbNext Step over the next statement (next in gdb)
<F11> :GdbStep Step into the next statement (step in gdb)
<F12> :GdbFinish Step out the current frame (finish in gdb)
<c-p> :GdbFrameUp Navigate one frame up (up in gdb)
<c-n> :GdbFrameDown Navigate one frame down (down in gdb)

Development

The goal is to have a thin wrapper around GDB, LLDB and PDB, just like the official TUI. NeoVim will enhance debugging with syntax highlighting and source code navigation.

References