gdb python setup problem

Yogesh Mundada
2010-03-17T21:19:39Z

Hi,

I am trying to use gdb scripting using python on karmic. My gdb
version is 7.0-ubuntu. If I start gdb and execute python command then
I get a python prompt (making me think that python patch is accepted
in gdb mainline now). However, if I write following script
(http://tromey.com/blog/?p=548):
----------------------
#!/home/yogesh/build/gdb/gdb -P
import sys
import gdb
print "Here"
----------------------

and execute it, I get following error:
----------------------
/home/yogesh/build/gdb/gdb: unrecognized option '-P'
Use `/home/yogesh/build/gdb/gdb --help' for a complete list of options.
----------------------

Then I got the source code from archer-tromey-python branch as
mentioned in http://sourceware.org/gdb/wiki/PythonGdb. I compiled that
source code but still it did not have any -P option for python
scripting.

What should I do to get python scripting working with gdb?

-Yogesh