[BangPypers] python scripting in gdb

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


Hi,

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 (6.8.50.20090302-38.fc11)
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:
<http://www.gnu.org/software/gdb/bugs/>.
(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
....
....
(gdb)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

So, I thought I'd share this with you. More info here:
http://sourceware.org/gdb/wiki/ProjectArcher

cheers,
- 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