This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: RFC: add ability to "source" Python code
> Date: Wed, 11 Feb 2009 23:48:26 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: brobecker@adacore.com, tromey@redhat.com, bauerman@br.ibm.com, drow@false.org, pedro@codesourcery.com, gdb-patches@sourceware.org
>
> > Date: Wed, 11 Feb 2009 13:25:40 -0800
> > From: Matt Rice <ratmice@gmail.com>
> > Cc: Joel Brobecker <brobecker@adacore.com>, tromey@redhat.com, bauerman@br.ibm.com, drow@false.org, pedro@codesourcery.com, gdb-patches@sourceware.org
> >
> > On Wed, Feb 11, 2009 at 1:06 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> > >
> > > Also, would an arbitrary Python script necessarily do anything useful
> > > in GDB? Some of them probably will, but not just any one, I think.
> > >
> >
> > Yes,
> >
> > (gdb) python execfile("/home/ratmice/bar.py")
> > (gdb) python foo()
> > foo
> >
> > where the foo function is defined in bar.py.
> > so it acts just like 'source' in a shell i would imagine.
>
> Sorry, I don't understand how this is related.
I mean I don't understand how printing "foo" is doing "something
useful in GDB".