GithubHelp home page GithubHelp logo

jamesborg46 / nvim-gdb Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sakhnik/nvim-gdb

0.0 0.0 0.0 714 KB

Neovim thin wrapper for GDB, LLDB, PDB/PDB++ and BashDB

Vim Script 4.68% C++ 0.67% Python 89.51% Shell 5.14%

nvim-gdb's Introduction

Branch Status Description
master Travis Build Status Modern version implemented as a remote Python plugin
moonscript Travis Build Status Experimental version implemented in Moonscript and some VimL
legacy Travis Build Status The original version mostly in VimL and some Python

Codacy Badge

GDB for neovim

Gdb, LLDB, pdb/pdb++ and BASHDB 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. Or type <leader>db to start debugging a BASH script.

nvim-gdb

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 \| UpdateRemotePlugins' }

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:

" We're going to define single-letter keymaps, so don't try to define them
" in the terminal window.  The debugger CLI should continue accepting text commands.
function! NvimGdbNoTKeymaps()
  tnoremap <silent> <buffer> <esc> <c-\><c-n>
endfunction

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

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
<Leader>db :GdbStartBashDB bashdb main.sh Start BASH 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)

You can create a watch window evaluating a backend command on every step. Try :GdbCreateWatch info locals in GDB, for istance.

Development

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

References

Showcase

nvim-gdb + llvm

clone + deploy + test

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.