[BangPypers] python scripting in gdb

steve steve at lonetwin.net
Mon Oct 19 13:32:42 CEST 2009


I was pleasantly surprised today to learn about Fedora/Red Hat's project, 
introduced in F11, to make scripting with python possible within gdb:
[steve at laptop ~]$ gdb
GNU gdb (GDB) Fedora (
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
(gdb) help python
Evaluate a Python command.

The command can be given as an argument, for instance:

     python print 23

If no argument is given, the following lines are read and used
as the Python commands.  Type a line containing "end" to indicate
the end of the command.
(gdb) python import this
The Zen of Python, by Tim Peters

So, I thought I'd share this with you. More info here:

- steve
random non tech spiel: http://lonetwin.blogspot.com/
tech randomness: http://lonehacks.blogspot.com/
what i'm stumbling into: http://lonetwin.stumbleupon.com/

More information about the BangPypers mailing list