Re: RFC: add ability to "source" Python code

Joel Brobecker
2009-02-11T22:01:30Z

OK, this is going to be my final message on the subject. This is not
sufficiently important for me to spend more energy on this.

> > Perhaps, but I believe that it makes the feature much much less useful
> > that it would be.
>
> I think that's a heck of exaggeration. We are talking about adding a
> single line.

I could return the "heck of exaggeration" back by saying that we're only
talking about the highly improbably GDB scripts whose name uses a standard
Python extension. Perhaps we should do a poll on gdb asking if anyone
has a GDB script that has such an extension?

> > I'd like to be able to grab a Python script, any python script, and
> > evaluate it in GDB.
>
> Doesn't that work with "python FOO" right now?

No, you have to do (IIRC):

(gdb) python execfile ("/my/python/script.py")

> Also, would an arbitrary Python script necessarily do anything useful
> in GDB? Some of them probably will, but not just any one, I think.

Maybe not anything, but yes, some of them. I'm starting to use Python
more and more and my collection of scripts is slowly building up.
Some of them setup environments, etc.

--
Joel