From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32578 invoked by alias); 15 Jan 2010 07:21:11 -0000 Received: (qmail 32567 invoked by uid 22791); 15 Jan 2010 07:21:10 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 15 Jan 2010 07:21:06 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id AEEC52BABC0; Fri, 15 Jan 2010 02:21:04 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id pDEDGWfdMFC9; Fri, 15 Jan 2010 02:21:04 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id AA3B32BAB9A; Fri, 15 Jan 2010 02:21:03 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 76E32F5970; Fri, 15 Jan 2010 11:20:54 +0400 (RET) Date: Fri, 15 Jan 2010 07:21:00 -0000 From: Joel Brobecker To: Thiago Jung Bauermann Cc: Tom Tromey , Eli Zaretskii , drow@false.org, pedro@codesourcery.com, gdb-patches@sourceware.org Subject: Re: RFC: add ability to "source" Python code Message-ID: <20100115072054.GA4191@adacore.com> References: <20090212062654.GG13021@adacore.com> <20090213022246.GA5401@adacore.com> <20090217000746.GA3812@adacore.com> <20090219200536.GA25486@adacore.com> <1243828612.9045.9.camel@hactar> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1243828612.9045.9.camel@hactar> User-Agent: Mutt/1.5.20 (2009-06-14) 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: 2010-01/txt/msg00400.txt.bz2 > This patch implements such tri-state setting: > > (gdb) help set script-extension > Set mode for script filename extension recognition. > off == no filename extension recognition (all sourced files are GDB scripts) > soft == evaluate script according to filename extension, fallback to GDB script > hard == evaluate script according to filename extension, error if not supported > > 2009-06-01 Tom Tromey > Thiago Jung Bauermann > > * python/python.c (source_python_script): New function. > * python/python.h (source_python_script): Declare. > * cli/cli-cmds.c (find_argument): New function. > (source_command): Use find_argument. Handle -p argument. Use > make_cleanup_restore_integer. > (source_verbose_cleanup): Remove. > (source_python): New global. > Include python.h. > (init_cli_cmds): Update. > > 2009-06-01 Tom Tromey > > * gdb.texinfo (File Options): Document -x on .py files. > (Command Files): Document source -p. > > 2009-06-01 Tom Tromey > Thiago Jung Bauermann > > * gdb.base/help.exp: Update "source" help text. > * gdb.python/source2.py: New file. > * gdb.python/source1: New file. > * gdb.python/python.exp: Test "source" command. This was approved a long time ago, with s/hard/strict/. Did we just forget to apply it? I'm playing with python, right now, and it was just brutal trying to find a way to "source" a file. Refresher for those like me who are not completely fluent in Python. It's: (gdb) python "execfile your-file.py" -- Joel