From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6713 invoked by alias); 10 Feb 2009 01:29:51 -0000 Received: (qmail 6694 invoked by uid 22791); 10 Feb 2009 01:29:50 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 10 Feb 2009 01:29:43 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n1A1RfNS019292; Mon, 9 Feb 2009 20:27:41 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n1A1RebU012066; Mon, 9 Feb 2009 20:27:41 -0500 Received: from opsy.redhat.com (vpn-12-231.rdu.redhat.com [10.11.12.231]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n1A1RePQ030059; Mon, 9 Feb 2009 20:27:40 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id 2BBB88880F4; Mon, 9 Feb 2009 18:27:32 -0700 (MST) To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: RFC: add ability to "source" Python code References: <200902100000.22671.pedro@codesourcery.com> From: Tom Tromey Reply-To: Tom Tromey Date: Tue, 10 Feb 2009 01:29:00 -0000 In-Reply-To: <200902100000.22671.pedro@codesourcery.com> (Pedro Alves's message of "Tue\, 10 Feb 2009 00\:00\:22 +0000") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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/msg00213.txt.bz2 >>>>> "Pedro" == Pedro Alves 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. Anyway, I think having "source" look at a #! line would not be very helpful. Most Python source files do not start with this. Yes, you can write: python blah blah blah end in a file and then source that. IME, this is not always convenient. In practice, though, I find I use the .py extension feature a lot more than "-p". I can remove the "-p" feature if that will make you and Eli and Doug happy. Pedro> Say that in the future we add support for another scripting language Pedro> to GDB, and we want to keep the current python support working in Pedro> parallel. As a matter of example, let's call it "Python 3.0". Would Pedro> we want to add more "-p" switches to the source command? I don't think Python 3.0 is a good example. I think we'll only be able to link GDB against a single version of Python. If someone adds other scripting languages to GDB, then yes, I would support new a option to "source". I would also support having "source" know about common file extensions for the new language. Tom