Re: gdb python setup problem

Zi Shen Lim
2010-03-17T21:27:48Z

In GDB 7.0, you can get into a python shell: '(gdb) python'.

To source a python script (e.g. '(gdb) source myscript.py'), you'll
need GDB 7.1.

On Wed, Mar 17, 2010 at 2:19 PM, Yogesh Mundada
<yogesh.mundada@gmail.com> wrote:
> 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
>