Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Doug Evans <xdje42@gmail.com>
Cc: gdb-patches@sourceware.org, ludo@gnu.org
Subject: Re: [PATCH, doc RFA] Add guile gdb command support
Date: Mon, 02 Jun 2014 15:33:00 -0000	[thread overview]
Message-ID: <83wqcz9vil.fsf@gnu.org> (raw)
In-Reply-To: <m3vbskdv9d.fsf@sspiff.org>

> From: Doug Evans <xdje42@gmail.com>
> 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.


  reply	other threads:[~2014-06-02 15:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-21 19:28 Doug Evans
2014-05-22 15:40 ` Eli Zaretskii
2014-05-22 16:39   ` Eli Zaretskii
2014-06-02  0:13   ` Doug Evans
2014-06-02 15:33     ` Eli Zaretskii [this message]
2014-06-03  7:33       ` Doug Evans
2014-06-03  8:33         ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83wqcz9vil.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=ludo@gnu.org \
    --cc=xdje42@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox