Vim.pl Icon

VIMGdb

current version: 6

News

30 Mar 2004

» VIMGdb patch - v. 6

15 Mar 2004

» VIMGdb patch - v. 5

21 Feb 2004

» VIMGdb patch - v. 4

18 Feb 2004

» VIMGdb - updated docs

15 Feb 2004

» New design
» VIMGdb patch - v. 3

VIMGdb is a Vim feature currently being developed that implements a Gdb annotated interface on Vim. It provides all Emacs features and some more such as:

  • breakpoints highlighting in source and assembly code
  • expressions may be dropped in a window and are updated and highlighted when changed
  • assembly $pc highlighting
  • on the fly disassembly
  • real-time target status display
  • Gdb syntax highlighting
  • automatic source file loading

Download

To get the latest patch to be applied on Vim 6.2 and the INSTALL.txt, gdb_design.txt and gdb.txt (:help add-local-help) documents:

Manual

Here you can read manual.

And here about internals: GDB feature design.

Report bugs

VIMGdb is at the development stage. It is not a Vim supported feature, and at the moment it is not planned to be one. To know more about VIMGdb consult Vim development mailing list <vim-dev@vim.org> or the mail-list archive.

ChangeLog

30 Mar 2004 (version 6)

 
VimGDB patch 6 may run in two different modes
called level 2 and level 3. Level 2 uses GDB
annotations level 2. Level 3 uses GDB/MI and
annotations level 3 and runs on GDB 6.0. When
starting, VimGDB automatically selects the
appropriate mode.

A new VimGDB command named "createvar" is used to
drop a variable in the variables window (the
variables window was named the display window in
the previous patch). It is even easier to select
in Visual mode the variable that one wants to
drop, and just hit CTRL-P. The "createvar" command
is mapped to the GDB "display" command in level 2.
In level 3 the "createvar" command is internally
mapped to GDB/MI commands. Deleting a line in the
variables window removes all the corresponding
references to the tracked variable in GDB and
VimGDB.

It is well worth upgrading to GDB 6.0 or later in
order to run VimGDB with level 3, as this level,
by using GDB/MI, provides much better correctness
in the display of variable values (see gdb.txt).

This patch also fixes the following bugs:
. "disable" and "delete" commands were not
  updating the breakpoint highlighting sign
  immediately, but only after the next time the
  debuggee stopped

. GUI version:
- when compiled with ! HAVE_GETTIMEOFDAY, the
  first keystroke after a GDB command was hidden

- when compiled with HAVE_GETTIMEOFDAY (most
  systems), the first keystroke after a GDB
  command appeared sometimes after a timeout of
  about 'updatetime'

. GUI version, when hitting repeatedly a mapped
  key, for example 'S' for the "step" command, the
  last "step" command was completed sometimes after
  a timeout of 'updatetime'

The 'gdbvariables' option name replaces the
'gdbdisplay' option name.  gdbvar.vim replaces
gdbdisplay.vim.
gdb_mappings.vim and gdb.vim have been slightly
changed to accomodate for the new "createvar"
command and the out of scope highlighting used in
level 3.

15 Mar 2004 (version 5)

 
This patch implements the gdb display window using
GDB "Automatic display" feature. One can "drop"
any valid expression in the display window and
visualize its value. This value is updated
whenever the debuggee stops and is highlighted by
the gdb interface when changed.  See gdb.txt. The
gdb_mappings.vim file has been updated to include
the CTRL-P mapping for dropping a Visual selected
expression. A new syntax file named gdbdisplay.vim
is used for highlighting changed values (see
INSTALL.txt).

The patch also introduces a small change that
allows the user to be warned when the gdb
interface discards a user GDB command because GDB
is busy. Previously, these commands where silently
discarded.

The patch introduces a big performance improvement
when using assembly buffers. When looking for an
address in assembly buffers, the gdb interface
uses the disassembled function name and search
only those buffers whose name starts with that
name (instead of searching all assembly buffers).
Starting from this patch, the bigger the assembly
buffer pool is the better for performance.

DESIGN.txt has been rewritten using Vim help
syntax and renamed to gdb_design.txt. It has also
been reworked entirely and should be easier 
to understand.  

Details:
- option.c, option.h
- gdb.c
  process_display
- gdb.c
  oob function get_display
- gdb.c
  oob function undisplay
  gdb display window
- gdb.c:gdb_docmd()
  give_warning("GDB busy: 
    command discarded, please retry", TRUE);
- gdb.c:get_asmfunc()
- gdb.c:get_asmfunc_hack()
- gdb.c:get_asm()
- gdb.c:as_frset()
  when looking for an address in asm buffers, 
  search only those buffers whose name starts with
  function name

21 Feb 2004 (version 4)

This patch completes the previous patch 3 and its
handling of breakpoints in assembly code. It fixes
also two minor bugs.

When asm mode is enabled and there is no debugging
information or source files, setting a breakpoint
causes the function containing the breakpoint to
be disassembled and displayed in an asm buffer.
The breakpoint line is highlighted.  Setting
a breakpoint, stepping, going up and down the
frame stack, etc... are now operations that all
behave in the same way in asm buffers as in source
files.

One of the bug was not externally visible:
ANO_BP_END annotation was never parsed.

The other bug description is: the names of asm
buffers were not always built from the name of the
disassembled function.

Details:
- gdb.c:get_lastbp()
  see section "Highlighting breakpoints in
  assembly code" in DESIGN.txt
- gdb.c:get_asm()
  correct handling of new asm buffer names
- gdb.c:parse_note()
  restrict annotation parsing to exact token
  match, not just the beginning (ANO_BP_END was
  never parsed)

12 Feb 2004 (version 3)



Patch 3 includes the management of breakpoints
through GDB annotations (instead of by parsing
user commands and the gdb buffer), and a fix to
the backtrace command.

What has changed since patch 2:

Checkpoint signs have their number (last two
digits) as the text zone. Thus, they can be
directly identified by looking in the source code
or asm window.

2) Disabled breakpoints are highlighted with
   a different (green) color.  The GDB commands
   tbreak, thbreak, disable, enable once, enable
   delete change the state of a breakpoint. When
   these functions are used, the highlighting sign
   now behaves appropriately.  Note that an
   'enable once' breakpoint can never be set back
   to the permanently enabled state (don't know if
   it's a GDB bug or feature)

3) Breakpoints in assembly code are highlighted
   the same way as when in symbolic source code,
   behaving also correctly when the above
   functions are used.  If, when the breakpoint is
   set, no asm buffer in the pool contains the
   function where this bp is set, then no sign is
   set. It will be set each time this function
   happens to be disassembled in an asm buffer
   (for example, when the program stops at this
   breakpoint, but not only in this case).

4) If a breakpoint contains 'commands' and these
   'commands' end with a 'cont[inue]' (or 'c')
   statement, then the interface does not attempt
   to edit the corresponding buffer. Before this
   patch, it would have done that, possibly
   flashing the buffer very rapidly on the screen.

5) The interface now tracks 'backtrace', 'bt',
   'where' and 'info stack' (all equivalent) user
   GDB commands, and ignores frame annotations in
   this case. This avoids having this annoying
   outer frame displayed systematically when
   running a backtrace command and Vim option
   'asm' is set.

Breakpoints in assembly code can also be set/unset
with a key mapping.  The key mappings <C-B>
and <C-E> are redefined in gdb_mappings.vim
to 'set a breakpoint' / 'clear all breakpoints' on
the cursor line in symbolic source code as well as
in assembly code.

Older versions