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

Tom Tromey
2009-02-10T01:30:55Z

>>>>> "Doug" == Doug Evans <dje@google.com> writes:

Doug> In the case of "source foo.py" I sort of disagree (that's the
Doug> other 1/4, fwiw). Technically speaking it's possible that some
Doug> bloke out there has a foo.py script that actually is gdb
Doug> commands, and forcing the script to be interpreted as python
Doug> would break that. It's seems really unlikely though.

I think it is beyond unlikely, and more in the realm of "has never
been done, ever, by any gdb user".

Doug> Perhaps "source" could/should also take a -g option to force the
Doug> script to be interpreted as gdb commands.

It would be fine by me.

Also I could add "--" to stop argument interpretation.
I don't think anybody will ever actually use this, but it would
make it obvious how to source a file with an odd name.

Well... most odd names. You cannot source a file whose name ends in a
space.

Tom