minimal_gdb


Ⅰ. 插件描述

:bug: Lightweight vim -> gdb broker which uses .gdbinit gdb config file to export breakpoints

Ⅱ. 基本信息

创建日期:  2013-11-01
使用用户:  1
Github星:  15
插件作者:  Dmitry Ignatovich

Ⅲ. 安装方法

使用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:

  1. Set some breakpoints in vim, they will be highlighted in the 'sign' column
  2. Run gdb, which will automatically export the breakpoints from step 1.
  3. Set some more breakpoints in vim
  4. Export them in gdb by using syncbp command, 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:

  • MinGDBToggleBP or <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.

添加新评论