From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6617 invoked by alias); 26 Jan 2012 06:21:36 -0000 Received: (qmail 6607 invoked by uid 22791); 26 Jan 2012 06:21:34 -0000 X-SWARE-Spam-Status: No, hits=-2.0 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; Thu, 26 Jan 2012 06:21:11 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 7769B2BB274; Thu, 26 Jan 2012 01:21:10 -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 1yTkjpszZyQK; Thu, 26 Jan 2012 01:21:10 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id DEEE62BB24D; Thu, 26 Jan 2012 01:21:09 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id BC803145615; Thu, 26 Jan 2012 10:21:03 +0400 (RET) Date: Thu, 26 Jan 2012 07:18:00 -0000 From: Joel Brobecker To: Jan Kratochvil Cc: Pedro Alves , gdb-patches@sourceware.org, Doug Evans Subject: Re: [patch] Do not open Python scripts twice #2 [Re: [RFC] Crash sourcing Python script on Windows] Message-ID: <20120126062103.GU31383@adacore.com> References: <20120123210850.GA28792@host2.jankratochvil.net> <20120123221706.GA21051@host2.jankratochvil.net> <20120124143609.GA20367@host2.jankratochvil.net> <20120124194044.GA2855@host2.jankratochvil.net> <20120124221945.GA15222@host2.jankratochvil.net> <20120125212636.GA23994@host2.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120125212636.GA23994@host2.jankratochvil.net> 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: 2012-01/txt/msg00888.txt.bz2 Hi Jan, > gdb/ > 2012-01-25 Jan Kratochvil > > Do not open script filenames twice. > * cli/cli-cmds.c (source_script_from_stream): Pass to > source_python_script also STREAM. > * python/py-auto-load.c (source_section_scripts): Pass to > source_python_script_for_objfile also STREAM. > (auto_load_objfile_script): Pass to source_python_script_for_objfile > also INPUT. > * python/python-internal.h (source_python_script_for_objfile): New > parameter file, rename parameter file to filename. > * python/python.c (python_run_simple_file): Call PyRun_SimpleFile > instead if !_WIN32. Update the function comment. > (source_python_script, source_python_script_for_objfile) > (source_python_script): New parameter file, rename parameter file to > filename. Pass FILENAME to python_run_simple_file. > * python/python.h (source_python_script): New parameter file, rename > parameter file to filename. The patch looks good to me and I would probably have come up with the same sort of changes myself. I tested it on x86-windows, and sourcing Python files still worked perfectly. I also ran it against AdaCore's testsuite and no regression either. -- Joel