From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3706 invoked by alias); 17 Feb 2009 04:12:47 -0000 Received: (qmail 3697 invoked by uid 22791); 17 Feb 2009 04:12:46 -0000 X-SWARE-Spam-Status: No, hits=-0.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_JMF_BL,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout6.012.net.il (HELO mtaout6.012.net.il) (84.95.2.16) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 17 Feb 2009 04:12:36 +0000 Received: from conversion-daemon.i-mtaout6.012.net.il by i-mtaout6.012.net.il (HyperSendmail v2007.08) id <0KF600D00ZMFOS00@i-mtaout6.012.net.il> for gdb-patches@sourceware.org; Tue, 17 Feb 2009 06:12:58 +0200 (IST) Received: from HOME-C4E4A596F7 ([84.228.82.14]) by i-mtaout6.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KF60010OZPI8840@i-mtaout6.012.net.il>; Tue, 17 Feb 2009 06:12:56 +0200 (IST) Date: Tue, 17 Feb 2009 05:54:00 -0000 From: Eli Zaretskii Subject: Re: RFC: add ability to "source" Python code In-reply-to: <20090217000746.GA3812@adacore.com> To: Joel Brobecker Cc: tromey@redhat.com, bauerman@br.ibm.com, drow@false.org, pedro@codesourcery.com, gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: References: <20090211203921.GC13021@adacore.com> <20090211220118.GE13021@adacore.com> <20090212062654.GG13021@adacore.com> <20090213022246.GA5401@adacore.com> <20090217000746.GA3812@adacore.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/msg00342.txt.bz2 > Date: Mon, 16 Feb 2009 16:07:46 -0800 > From: Joel Brobecker > Cc: tromey@redhat.com, bauerman@br.ibm.com, drow@false.org, > pedro@codesourcery.com, gdb-patches@sourceware.org > > Let's see what everyone thinks. I have several issues that I'd like > to discuss before we can finalize a proposal: My responses below. > 1. If we have filename-extension detection (controlled by a setting), > do we need the "-p" switch at all? If we agreed that it's an > acceptable limitation that python scripts in GDB should have > a .py extension, then we don't really need the .py switch, > do we? This in turn would side-step the question of what to do > with -p when python wasn't compiled in. I'm okay with this, but I think Tom had some valid reasons for having Python scripts that don't have a certain extension. > Or maybe, how about changing the semantics of that setting > to apply to files that are detected as python (regardless of > how the detection is performed): In one case these files are > sourced as python script, but on the other, these files are > still treated as GDB scripts. When GDB was built with python, > then this switch can be used to turn the new feature off, > whereas if no python was available, the setting would be stuck > to the value where files are sourced as GDB scripts. Fine with me. > Now that I've written all this and that it has given me a chance > to think this over a little more, I like the idea of falling back > to GDB scripts less and less. So much so that I'm wondering whether > using a different command than "source" might be better? "pysource" > for instance? I think there is already a way to do that: the `python' command. I think the `source' proposal was intended to treat Python scripts more similar to GDB scripts, and I generally agree with that idea, i.e. that we should have a single command that sources scripts.