Git Product home page Git Product logo

neodebug's Introduction

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)

neodebug's People

Contributors

cpiger avatar

Watchers

James Cloos avatar

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.