This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC][python] Add support for commands implemented in Python
> From: Thiago Jung Bauermann <bauerman@br.ibm.com>
> Cc: Eli Zaretskii <eliz@gnu.org>, gdb-patches@sourceware.org
> Date: Fri, 06 Feb 2009 19:34:42 -0200
>
> El vie, 06-02-2009 a las 13:52 -0700, Tom Tromey escribió:
> > Thiago> I like your idea, I'm not sure if there was good reason for the
> > Thiago> deviation other than that it was already present in the GDB source code
> > Thiago> already. Tom, what do you think?
> >
> > It would be fine by me. I chose these names to mostly follow the
> > internals, but following the help categories would also be ok.
>
> Great, I committed the following.
Thanks. I fixed a few typos in your last patch, and also fixed a typo
in a previous change from several days ago. While at that, I changed
@code to @kbd in describing interactive input, and added a few
cross-references and index entries. Here's what I checked in:
2009-02-07 Eli Zaretskii <eliz@gnu.org>
* gdb.texinfo (Basic Python): Fix change from 2009-02-04.
(Commands In Python): Fix COMMAND_* constants in last change. Use
@kbd for interactive input. Add cross-references and index
entries.
Index: gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.557
diff -u -r1.557 gdb.texinfo
--- gdb.texinfo 6 Feb 2009 22:59:01 -0000 1.557
+++ gdb.texinfo 7 Feb 2009 09:57:44 -0000
@@ -18171,7 +18171,7 @@
If @var{number} is negative, then @value{GDBN} will take its absolute value
and count backward from the last element (i.e., the most recent element) to
find the value to return. If @var{number} is zero, then @value{GDBN} will
-return the most recent element. If the element specified by @value{number}
+return the most recent element. If the element specified by @var{number}
doesn't exist in the value history, a @code{RuntimeError} exception will be
raised.
@@ -18353,6 +18353,7 @@
not documented.'' is used.
@end defmethod
+@cindex don't repeat Python command
@defmethod Command dont_repeat
By default, a @value{GDBN} command is repeated when the user enters a
blank line at the command prompt. A command can suppress this
@@ -18374,11 +18375,13 @@
@code{error} call. Otherwise, the return value is ignored.
@end defmethod
+@cindex completion of Python commands
@defmethod Command complete text word
This method is called by @value{GDBN} when the user attempts
completion on this command. All forms of completion are handled by
-this method, that is, the @key{TAB} and @key{M-?} key bindings, and
-the @code{complete} command.
+this method, that is, the @key{TAB} and @key{M-?} key bindings
+(@pxref{Completion}), and the @code{complete} command (@pxref{Help,
+complete}).
The arguments @var{text} and @var{word} are both strings. @var{text}
holds the complete command line up to the cursor's location.
@@ -18423,18 +18426,18 @@
@findex COMMAND_RUNNING
@findex gdb.COMMAND_RUNNING
-@item COMMAND_RUN
+@item COMMAND_RUNNING
The command is related to running the inferior. For example,
@code{start}, @code{step}, and @code{continue} are in this category.
-Type @code{help running} at the @value{GDBN} prompt to see a list of
+Type @kbd{help running} at the @value{GDBN} prompt to see a list of
commands in this category.
@findex COMMAND_DATA
@findex gdb.COMMAND_DATA
-@item COMMAND_VARS
+@item COMMAND_DATA
The command is related to data or variables. For example,
@code{call}, @code{find}, and @code{print} are in this category. Type
-@code{help data} at the @value{GDBN} prompt to see a list of commands
+@kbd{help data} at the @value{GDBN} prompt to see a list of commands
in this category.
@findex COMMAND_STACK
@@ -18442,7 +18445,7 @@
@item COMMAND_STACK
The command has to do with manipulation of the stack. For example,
@code{backtrace}, @code{frame}, and @code{return} are in this
-category. Type @code{help stack} at the @value{GDBN} prompt to see a
+category. Type @kbd{help stack} at the @value{GDBN} prompt to see a
list of commands in this category.
@findex COMMAND_FILES
@@ -18450,7 +18453,7 @@
@item COMMAND_FILES
This class is used for file-related commands. For example,
@code{file}, @code{list} and @code{section} are in this category.
-Type @code{help files} at the @value{GDBN} prompt to see a list of
+Type @kbd{help files} at the @value{GDBN} prompt to see a list of
commands in this category.
@findex COMMAND_SUPPORT
@@ -18460,31 +18463,31 @@
things that are useful to the user when interacting with @value{GDBN},
but not related to the state of the inferior. For example,
@code{help}, @code{make}, and @code{shell} are in this category. Type
-@code{help support} at the @value{GDBN} prompt to see a list of
+@kbd{help support} at the @value{GDBN} prompt to see a list of
commands in this category.
@findex COMMAND_STATUS
@findex gdb.COMMAND_STATUS
-@item COMMAND_INFO
+@item COMMAND_STATUS
The command is an @samp{info}-related command, that is, related to the
state of @value{GDBN} itself. For example, @code{info}, @code{macro},
-and @code{show} are in this category. Type @code{help status} at the
+and @code{show} are in this category. Type @kbd{help status} at the
@value{GDBN} prompt to see a list of commands in this category.
@findex COMMAND_BREAKPOINTS
@findex gdb.COMMAND_BREAKPOINTS
-@item COMMAND_BREAKPOINT
+@item COMMAND_BREAKPOINTS
The command has to do with breakpoints. For example, @code{break},
-@code{clear}, and @code{delete} are in this category. Type @code{help
+@code{clear}, and @code{delete} are in this category. Type @kbd{help
breakpoints} at the @value{GDBN} prompt to see a list of commands in
this category.
@findex COMMAND_TRACEPOINTS
@findex gdb.COMMAND_TRACEPOINTS
-@item COMMAND_TRACE
+@item COMMAND_TRACEPOINTS
The command has to do with tracepoints. For example, @code{trace},
@code{actions}, and @code{tfind} are in this category. Type
-@code{help tracepoints} at the @value{GDBN} prompt to see a list of
+@kbd{help tracepoints} at the @value{GDBN} prompt to see a list of
commands in this category.
@findex COMMAND_OBSCURE
@@ -18492,7 +18495,7 @@
@item COMMAND_OBSCURE
The command is only used in unusual circumstances, or is not of
general interest to users. For example, @code{checkpoint},
-@code{fork}, and @code{stop} are in this category. Type @code{help
+@code{fork}, and @code{stop} are in this category. Type @kbd{help
obscure} at the @value{GDBN} prompt to see a list of commands in this
category.
@@ -18501,7 +18504,7 @@
@item COMMAND_MAINTENANCE
The command is only useful to @value{GDBN} maintainers. The
@code{maintenance} and @code{flushregs} commands are in this category.
-Type @code{help internals} at the @value{GDBN} prompt to see a list of
+Type @kbd{help internals} at the @value{GDBN} prompt to see a list of
commands in this category.
@end table