Ⅰ. 插件描述
:bug: Lightweight vim -> gdb broker which uses .gdbinit gdb config file to export breakpointsⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'mechatroner/minimal-gdb'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'mechatroner/minimal-gdb'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'mechatroner/minimal-gdb'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/mechatroner/minimal_gdb
Ⅳ. 文档说明
# Minimal gdb
Minimal gdb is a lightweight vim -> gdb broker which uses .gdbinit mechanism to export breakpoints from vim into gdb session.
The plugin provides <leader>b shortcut which allows user to set breakpoints while in vim. Breakpoints are added to special file which is sourced from ~/.gdbinit (this source magic will be performed on the first run). When gdb starts all breakpoints are getting exported. If you add more breakpoints after gdb was started you have to execute syncbp command in gdb to reexport breakpoints from vim. syncbp is added to gdb via the same .gdbinit magic.
The plugin doesn't provide functionality for debugging in vim window. You have to start gdb session.
The main difference from other gdb vim plugins, is that Minimal gdb uses the .gdbinit file for breakpoint export and doesn't provide functionality for debugging inside vim window.
A typical use case looks like this:
- Set some breakpoints in vim, they will be highlighted in the 'sign' column
- Run gdb, which will automatically export the breakpoints from step 1.
- Set some more breakpoints in vim
- Export them in gdb by using
syncbpcommand, or by restarting the debugger (the former is easier).
INSTALLATION:
Copy the files to your .vim folder or use Vundle.
The script will configure everything when you set a first breakpoint.
COMMANDS:
In vim:
MinGDBToggleBPor<leader>b- toggles a breakpoint.MinGDBDeleteAll- delete all breakpoints.MinGDBListAll- list all breakpoints in the quickfix window.MinGDBRefreshFile- refresh breakpoints positions in a vim file. Use this in case something went wrong.
In gdb:
syncbp- export new breakpoints from vim, which were set after gdb session has started.
REQUIREMENTS:
- gdb
- python 2.7, or 3.xx
- vim compiled with python and signs features.