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

Joel Brobecker
2009-02-13T02:22:56Z

> > Anyway, how about a compromise, then, and require the -p switch to
> > source python scripts? The incompatibility is that
> >
> > (gdb) source -p foo
> >
> > would no longer work for file "-p foo". I think that's an acceptable
> > "incompatibilty". Would you agree?
>
> This is a misunderstanding: I didn't mind the -p switch, I mind the
> fact that it throws an error if Python is not compiled in. Eliminate
> the error, and you have me on board.

Cool! So, just to make sure I understand what you're saying, you would
agree to the following change:

Add a -p switch to the "source" command that signifies that we're sourcing
a python script instead of a GDB script. We drop the part where we're
using the filename extension to guess the file language, thus preserving
the current behavior.

Finally, what should we do if trying to source a python script with
a debugger that does not have python linked in? Treat the -p switch
as part of the script filename? (I would find this really odd)

--
Joel