Skip to content

NeoDebug - Vim plugin for interface to gdb from Vim

Notifications You must be signed in to change notification settings

skywind3000/NeoDebug

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

NeoDebug - GDB Vim Frontend

Intro

NeoDebug is a gdb frontend plugin for Vim, asynchronously run gdb and pipe communication.

It both works on MS Windows and Linux.

It opens a DebugConsole window in vim that allows user to type gdb command directly, and gdb output is redirected to this windows.

Screenshot:

  1. Gdb command directly input and show result.

Screenshot

  1. Vim Style complete.

Vim style complete

  1. BallonShow.

ballonshow

  1. Breakpoints jump, threads, stack

info breakpoints

stack

threas

  1. info locals, breakpoints, threads, bt, registers

info

Installation

  1. You need install sed (and of course gdb).

  2. Use your preferred installation method for Vim plugins.

    With vim-plug that would mean to add the following to your vimrc:

    Plug 'cpiger/NeoDebug'

=========================================================

My dev environment:

=========================================================

Quick usage

In vim or gvim, run :NeoDebug command, e.g. See Screenshot.

:NeoDebug         "start gdb and open a gdb console buffer in vim

:DBGOpenConsole       "open neodebug console window
:DBGCloseConsole      "close neodebug console window
:DBGToggleConsole     "toggle neodebug console window

:DBGOpenLocals        "open  [info locals] window
:DBGOpenRegisters     "open  [info registers] window
:DBGOpenStacks        "open  [backtrace] window
:DBGOpenThreads       "open  [info threads] window
:DBGOpenBreaks        "open  [info breakpoints] window
:DBGOpenDisas         "open  [disassemble] window
:DBGOpenExpressions   "open  [Exressions] window
:DBGOpenWatchs        "open  [info watchpoints] window


:DBGCloseLocals       "close [info locals] window
:DBGCloseRegisters    "close [info registers] window
:DBGCloseStacks       "close [backtrace] window
:DBGCloseThreads      "close [info threads] window
:DBGCloseBreaks       "close [info breakpoints] window
:DBGCloseDisas        "close [disassemble] window
:DBGCloseExpressions  "close [Exressions] window       
:DBGCloseWatchs       "close [info watchpoints] window 

The following shortcuts is applied that is similar to MSVC:

<F5> 	- run or continue
<S-F5> 	- stop debugging (kill)
<F6> 	- toggle console window
<F10> 	- next
<F11> 	- step into
<S-F11> - step out (finish)
<C-F10>	- run to cursor (tb and c)
<F9> 	- toggle breakpoint on current line
<C-S-F10> - set next statement (tb and jump)
<C-P> 	- view variable under the cursor
<TAB>   - trigger complete 

Options:

let g:neodbg_debugger              = 'gdb'           " gdb,pdb,lldb
let g:neodbg_gdb_path              = '/usr/bin/gdb'  " gdb path
let g:neodbg_cmd_prefix            = 'DBG'           " default command prefix
let g:neodbg_console_height        = 15              " gdb console buffer hight, Default: 15
let g:neodbg_openbreaks_default    = 1               " Open breakpoints window, Default: 1
let g:neodbg_openstacks_default    = 0               " Open stackframes window, Default: 0
let g:neodbg_openthreads_default   = 0               " Open threads window, Default: 0
let g:neodbg_openlocals_default    = 1               " Open locals window, Default: 1
let g:neodbg_openregisters_default = 0               " Open registers window, Default: 0

Keymaps:

let g:neodbg_keymap_toggle_breakpoint  = '<F9>'         " toggle breakpoint on current line
let g:neodbg_keymap_next               = '<F10>'        " next
let g:neodbg_keymap_run_to_cursor      = '<C-F10>'      " run to cursor (tb and c)
let g:neodbg_keymap_jump               = '<C-S-F10>'    " set next statement (tb and jump)
let g:neodbg_keymap_step_into          = '<F11>'        " step into
let g:neodbg_keymap_step_out           = '<S-F11>'      " setp out
let g:neodbg_keymap_continue           = '<F5>'         " run or continue
let g:neodbg_keymap_print_variable     = '<C-P>'        " view variable under the cursor
let g:neodbg_keymap_stop_debugging     = '<S-F5>'       " stop debugging (kill)
let g:neodbg_keymap_toggle_console_win = '<F6>'         " toggle console window
let g:neodbg_keymap_terminate_debugger = '<C-C>'        " terminate debugger

FAQ

Q: Where to get my program's Input and Output ?

A: You can use 'tty' command to redirected program's input and output on linux. A similar command under Windows is set new-console, that is default on NeoDebug. (GDB OnLine Docs)

TODO

  1. Breakpoints disable/enable

  2. vim swap file notification

  3. source file changed notification and update breakpoints

  4. Options add: info windows group customized.

Thanks

skyshore2001

(https://github.com/skyshore2001/vgdb-vim)

Bram Moolenaar

(vim80\pack\dist\opt\termdebug\plugin\termdebug.vim)

About

NeoDebug - Vim plugin for interface to gdb from Vim

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vim Script 100.0%