From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2624 invoked by alias); 2 Feb 2009 20:08:22 -0000 Received: (qmail 2614 invoked by uid 22791); 2 Feb 2009 20:08:21 -0000 X-SWARE-Spam-Status: No, hits=2.6 required=5.0 tests=AWL,BAYES_00,BOTNET,J_CHICKENPOX_37,RCVD_IN_JMF_BL,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout1.012.net.il (HELO mtaout1.012.net.il) (84.95.2.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 02 Feb 2009 20:08:16 +0000 Received: from conversion-daemon.i-mtaout1.012.net.il by i-mtaout1.012.net.il (HyperSendmail v2007.08) id <0KEG00400FP3N800@i-mtaout1.012.net.il> for gdb-patches@sourceware.org; Mon, 02 Feb 2009 22:08:34 +0200 (IST) Received: from HOME-C4E4A596F7 ([84.228.158.130]) by i-mtaout1.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KEG0017HFY30D20@i-mtaout1.012.net.il>; Mon, 02 Feb 2009 22:08:28 +0200 (IST) Date: Mon, 02 Feb 2009 20:08:00 -0000 From: Eli Zaretskii Subject: Re: [RFC][python] Add support for commands implemented in Python In-reply-to: <1233580405.7000.13.camel@localhost.localdomain> To: Thiago Jung Bauermann Cc: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: References: <1233580405.7000.13.camel@localhost.localdomain> 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/msg00038.txt.bz2 > From: Thiago Jung Bauermann > Date: Mon, 02 Feb 2009 11:13:25 -0200 > > gdb/doc/ > 2009-02-02 Tom Tromey > > * gdb.texinfo (Python API): Add entry for Commands In Python. > (Commands In Python): New node. Approved, with comments: > +The help text for the new command is taken from the Python > +documentation string for the command's class, if there is one. If > +there is no documentation string, a default value is used. Regarding the last sentence above: when I read this I asked myself what was the default value for the doc string. I suggest to state that. > +@defmethod Command complete text word > +This method is called by @value{GDBN} when the user attempts @key{TAB} > +completion on this command. Only TAB, or the other completion-related keys? what about M-?, for example? > +@item COMMAND_RUN > +The command is related to running the inferior. > + > +@findex COMMAND_VARS > +@findex gdb.COMMAND_VARS > +@item COMMAND_VARS > +The command is related to variables. I think it would be useful either to give a couple of examples of existing CLI commands that belong to each class, or at least explain how to use the "help" command to show commands in each class. I imagined myself sitting in front of this list and trying to figure out to which class to assign some command I wrote, and I think I would find these hints useful. Please keep in mind that users who would want to write new CLI commands are not necessarily GDB hackers privy to the add_cmd function and its ilk. > +@item COMMAND_FILES > +This class is used for file-related commands. Here's a case in point: many (most) GDB commands related to files actually deal with _executable_ files. > +@item COMMAND_SUPPORT Another case in point: what is ``support facilities''? Without an example, it leaves me wondering. Another question that was on my mind after reading this: what class is for help commands? > +A new command can use a predefined completion function, either by > +specifying it via an argument at initialization, or by return it from ^^^^^^ "returning" > +@item COMPLETE_LOCATION > +This constant means that location completion should be done. A cross-reference to where "locations" are described would be a good idea here. Finally, I think we need a NEWS entry for this feature.