Skip to content

Python and Gdb

Recently I’ve been hacking on integrating Python scripting support into gdb. For years now I’ve been wanting better scripting in gdb, but until I saw Volodya’s patch I never did anything about it. So, the other night I made a git repository (thanks gitorious!) and started hacking away. Thiago Bauermann did some nice updates on Volodya’s value-inspecting code, too.

A decent number of things are working. See the wiki page for details on cloning the repository.

Since I basically live in Emacs nowadays, I wanted to install the Python documentation in info form. Am I the only person who still loves info? It isn’t beautiful, to be sure, but it is amazingly convenient inside Emacs — simple to navigate, call up, and dismiss; with info-lookup it can function as a low-rent context-sensitive help; no messy fussing with the mouse.

Anyway, I couldn’t find this readily available anywhere, so in the end I checked out python myself and built the docs. That was sort of a pain… I’m half considering making an ELPA package out of the info pages. Come to think of it there are probably a number of potential info-only packages out there.


  1. tom (the other) wrote:

    Hey tom, I can only say that this is very cool. I’ve got some python scripts which generate gdb “scripts” which I use to inject tracing-prints to my programs externally.
    Vladimirs patch looks like I can use gdb directly in the future which would make my current hack much more readable.

    I have also started using quagmire for several small libs, and so far it works without failure. Is it possible to set a different build directory (where all the .o etc. go?

    Monday, March 17, 2008 at 10:00 pm | Permalink
  2. tom wrote:

    Quagmire follows the GNU style here — so you just make an entire build tree separate from your source tree.

    Tuesday, March 18, 2008 at 12:44 am | Permalink
  3. tom wrote:

    Oh, btw, questions like that are more than welcome on the Quagmire mailing list :-)

    Tuesday, March 18, 2008 at 12:44 am | Permalink

One Trackback/Pingback

  1. breaking code into reviewable patches « bauermann on Wednesday, April 30, 2008 at 4:45 am

    [...] before, I’ve been working on and off on adding Python scripting support to GDB, with Tom Tromey and Vladimir Prus. We did the work in a git repository, separate from the GDB main repo (which [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *