This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, doc RFA] Add guile gdb command support


> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]