From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25127 invoked by alias); 10 Feb 2009 02:36:25 -0000 Received: (qmail 25116 invoked by uid 22791); 10 Feb 2009 02:36:24 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 10 Feb 2009 02:36:14 +0000 Received: (qmail 16054 invoked from network); 10 Feb 2009 02:35:59 -0000 Received: from unknown (HELO orlando) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 10 Feb 2009 02:35:59 -0000 From: Pedro Alves To: Tom Tromey Subject: Re: RFC: add ability to "source" Python code Date: Tue, 10 Feb 2009 02:36:00 -0000 User-Agent: KMail/1.9.10 Cc: gdb-patches@sourceware.org References: <200902100000.22671.pedro@codesourcery.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200902100235.59897.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-02/txt/msg00216.txt.bz2 On Tuesday 10 February 2009 01:27:32, Tom Tromey wrote: > >>>> "Pedro" =3D=3D Pedro Alves writes: >=20 > Pedro> Could you explain for the archives why this is better than having > Pedro> the script itself tell GDB that it's running python? =A0Either > Pedro> through something similar to a shebang, or starting the script with > Pedro> "python" (does that work?) ? =A0I think you've discussed this befo= re, > Pedro> what were the limitations you found? >=20 > I think you may be thinking of invoking a python script using > "#!.../gdb -something". =A0This patch does not cover that case. =A0That is > a separate patch, which I haven't submitted. I was thinking of the case of sourcing a python script from inside gdb, not that. >=20 > Anyway, I think having "source" look at a #! line would not be very > helpful. =A0Most Python source files do not start with this. >=20 OK then. > Yes, you can write: >=20 > =A0 python > =A0 blah blah blah > =A0 end >=20 > in a file and then source that. =A0IME, this is not always convenient. Ah, I though I had heard mention that that this worked. If experience claims this isn't rightish, so be it. > In practice, though, I find I use the .py extension feature a lot more > than "-p". =A0I can remove the "-p" feature if that will make you and > Eli and Doug happy. Thanks for the explanations. I'm happy with or without it. --=20 Pedro Alves