sponsor Vim development Vim logo Vim Book Ad

pygdb : pygtk interface to gdb in connection with (g)vim

 script karma  Rating 4/1, Downloaded by 1536  Comments, bugs, improvements  Vim wiki

created by
Stefan Huber
 
script type
utility
 
description
pygdb is a pygtk interface to gdb. It offers two terminal windows, one for gdb, one for the process to be debugged. On the top it has standard buttons like run, continue, step in, step over, step out and quit. On a second window you can add watches and breakpoints. Furthermore, you can inspect the backtrace and launch gvim on the current executed line by pressing a button.

pygdb stays synchronized with gvim (by using gvim --servername calls). The package provides a pygdb.vim which enables the user to set (conditional) breakpoints and the current execution line is highlighted as well.

Default key mappings:
F5: Run
F8: Toggle breakpoint
S-F8: Conditional breakpoint
F9: Show breakpoints
S-F9: Load config

The package is in a very young state but I guess it is more or less usable. You may want to give it a try or look for some screenshots at
http://www.cosy.sbg.ac.at/~shuber/code-pygdb.php
at first. This project is somehow similar to vdb (vimscript #1703). The main difference is that vdb tries to integrate gdb completely into vim, in contrast to pygdb. However, under some assumptions on the debugger, other debuggers can be integrated easily as well. (Just inherit the DbgTerminal python class)

P.S. I don't have gvim-6 -- is anyone experiencing that the script works with vim-6 as well?
 
install details
INSTALL.txt:

1. Put the pygdb directory to somewhere, lets call it <dir> in this help file.
2. Add the following lines into your ~/.vimrc:

      """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
      "  pygdb
      """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

        autocmd Filetype c,cpp :python import sys
        autocmd Filetype c,cpp :python import vim
        autocmd Filetype c,cpp :python pygdbdir = "<dir>"
        autocmd Filetype c,cpp :python sys.path.append(pygdbdir)
        autocmd Filetype c,cpp :python vim.command("source %s/pygdb.vim" % pygdbdir)
        autocmd Filetype c,cpp call GDBMapDefaults()


   where you replace <dir> by the corresponding path of pygdb. You may want to
   add <dir> to the environment variable PATH such that you can call pygdb
   from console directly.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
pygdb-0.99.4.tar.bz2 0.99.4 2008-07-04 7.0 Stefan Huber bug fixes around breakpoint parsing, better backtrace view, dblclick on element navigates vim to source position. NOTE the change in install.txt!
pygdb-0.99.3.tar.bz2 0.99.3 2008-06-26 7.0 Stefan Huber fixing some bugs
pygdb-0.99.2.tar.bz2 0.99.2 2008-06-23 7.0 Stefan Huber scrollbars for terminals, parametrizeable vim-servername, loading python via .vimrc only when filetype matches.
pygdb-0.99.1.tar.bz2 0.99.1 2008-06-20 7.0 Stefan Huber Initial upload
ip used for rating: 44.210.86.29

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github