From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26759 invoked by alias); 19 Jan 2010 21:43:08 -0000 Received: (qmail 26699 invoked by uid 22791); 19 Jan 2010 21:43:07 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout20.012.net.il (HELO mtaout20.012.net.il) (80.179.55.166) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 19 Jan 2010 21:43:00 +0000 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0KWI00F00IT5M000@a-mtaout20.012.net.il> for gdb-patches@sourceware.org; Tue, 19 Jan 2010 23:42:44 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.70.14.77]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KWI00FUPKB2T520@a-mtaout20.012.net.il>; Tue, 19 Jan 2010 23:42:39 +0200 (IST) Date: Tue, 19 Jan 2010 21:43:00 -0000 From: Eli Zaretskii Subject: Re: [RFA/doco] Improve doc on how to execute a Python script from GDB. In-reply-to: <1263913679-22046-1-git-send-email-brobecker@adacore.com> To: Joel Brobecker Cc: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <83hbqh7ovh.fsf@gnu.org> References: <1263913679-22046-1-git-send-email-brobecker@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: 2010-01/txt/msg00480.txt.bz2 > From: Joel Brobecker > Cc: Joel Brobecker > Date: Tue, 19 Jan 2010 19:07:59 +0400 > > gdb/doc/ChangeLog: > > * gdb.texinfo (File Options): Adjust the documentation of this > switch to refer to the "source" command rather than partially > duplicating some of the relevant information. > (Extending GDB): Introduce and document the set/show script-extension > setting. > (Command Files): Add note explaining that the "source" command > is also used to evalute scripts written in other languages. > Remove the short slightly incorrect reference to sourcing Python > scripts. > (Python Commands): Document how to execute a Python script from GDB. > > I hope that this patch is going to improve the documentation, because > I ended up spending a lot of time working on it :-(. Thanks, I appreciate the effort. > +Execute commands from file @var{file}. The contents of this file is > +evaluated exactly as if it was evaluated using the @code{source} command. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ "exactly as the @code{source} command would." > +To facilitate the use of these extensions, @value{GDBN} is capable > +of evaluating the contents of a file. When doing so, @value{GDBN} > +can recognize which scripting language is being used by exploiting > +the filename extension. ^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^ "by looking at the filename extension" is simpler and more clear, I think. > +are always treated as a @value{GDBN} Command Files. Please move here the xref to where Command Files are described, which you have later. It should be where the term is first used. > To control how GDB > +evaluates these files, the following setting can be used: Avoid passive tense: You can control how @value{GDBN} evaluates these files with the following setting: > +The script name must end with @samp{.py} and GDB must be configured ^^^ @value{GDBN} > +@item python execfile ("script-name") > +This method is based on the @code{execfile} Python built-in function, > +and thus is always available. "always" as in "when Python is compiled in", right? Thanks again for working on this.