From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2032 invoked by alias); 2 Jun 2014 15:33:19 -0000 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 Received: (qmail 2023 invoked by uid 89); 2 Jun 2014 15:33:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mtaout20.012.net.il Received: from mtaout20.012.net.il (HELO mtaout20.012.net.il) (80.179.55.166) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 02 Jun 2014 15:33:17 +0000 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0N6J00500SJ5VZ00@a-mtaout20.012.net.il> for gdb-patches@sourceware.org; Mon, 02 Jun 2014 18:33:14 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N6J005AYSJEUT10@a-mtaout20.012.net.il>; Mon, 02 Jun 2014 18:33:14 +0300 (IDT) Date: Mon, 02 Jun 2014 15:33:00 -0000 From: Eli Zaretskii Subject: Re: [PATCH, doc RFA] Add guile gdb command support In-reply-to: To: Doug Evans Cc: gdb-patches@sourceware.org, ludo@gnu.org Reply-to: Eli Zaretskii Message-id: <83wqcz9vil.fsf@gnu.org> References: <83k39dn7ne.fsf@gnu.org> X-IsSubscribed: yes X-SW-Source: 2014-06/txt/msg00023.txt.bz2 > From: Doug Evans > Cc: gdb-patches@sourceware.org, ludo@gnu.org > Date: Sun, 01 Jun 2014 17:12:46 -0700 > > -This function is useful when computing values. > +This function can be useful when implementing a new command > +(@pxref{Commands In Guile}), as it provides a way to parse the > +command's argument as an expression. "argument" or "arguments"? Or maybe "any of the command's arguments"? > +You can implement new @value{GDBN} CLI commands in Guile. A CLI > +command object is created with the @code{make-command} Guile function, > +and added to @value{GDBN} with the @code{register-command!} Guile function. > +This two-step approach is taken to separate out the side-effect of adding > +the command to @value{GDBN} from @code{make-command}. > + > +There is no support for multi-line commands, that is commands that > +consist of multiple lines and are terminated with @code{end}. > + > +@c TODO: line length > +@deffn {Scheme Procedure} (make-command! name @r{[}#:invoke invoke{]} @r{[}#:command-class command-class@r{]} @r{[}#:completer-class completer{]} @r{[}#:prefix? prefix@r{]} @r{[}#:doc doc-string{]}) > + I'm confused: you mention 'make-command' and 'register-command!', but then document 'make-command!' and 'register-command!'? What am I missing? > +@smallexample > +(gdb) guile (use-modules (gdb)) > +(gdb) guile > +(make-command! "test-user-error" > + #:command-class COMMAND_OBSCURE > + #:invoke (lambda (self arg from-tty) > + (throw-user-error "Bad argument ~a" arg))) > +end And here you use a command before registering it? > +When a new command is registered, it must be declared as a member of > +some general class of commands. Actually, a command is declared as a member of some class at make-command time, not at register-command! time, right? If so, using "when a command is registered" here might confuse the reader. The documentation part is OK with these gotchas fixed. Thanks.