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

Eli Zaretskii
2009-02-10T09:34:34Z

> Date: Mon, 9 Feb 2009 22:48:34 -0500
> From: Daniel Jacobowitz <drow@false.org>
> Cc: Tom Tromey <tromey@redhat.com>, gdb-patches@sourceware.org
>
> On Tue, Feb 10, 2009 at 02:35:59AM +0000, Pedro Alves wrote:
> > On Tuesday 10 February 2009 01:27:32, Tom Tromey wrote:
> > > >>>> "Pedro" == Pedro Alves <pedro@codesourcery.com> writes:
> > >
> > > Pedro> Could you explain for the archives why this is better than having
> > > Pedro> the script itself tell GDB that it's running python? Â Either
> > > Pedro> through something similar to a shebang, or starting the script with
> > > Pedro> "python" (does that work?) ? Â I think you've discussed this before,
> > > Pedro> what were the limitations you found?
> > >
> > > I think you may be thinking of invoking a python script using
> > > "#!.../gdb -something". Â This patch does not cover that case. Â That is
> > > a separate patch, which I haven't submitted.
>
> I had something like "# *-python-*" in mind... :-)

Yes. I think this is by far the best solution, one that will keep
back compatibility without hampering any of the new and valuable
Python features.

Can we agree on using such cookies in GDB scripts written in Python?
Then we won't need the -p switch or the .py extension detection.