aboutsummaryrefslogtreecommitdiff
path: root/gdb/doc
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2012-03-01 19:30:25 +0000
committerDoug Evans <dje@google.com>2012-03-01 19:30:25 +0000
commit7d74f2446c5ebad93f62426e285b64de882db843 (patch)
treeb3bae2bccf6b51d2496c706ee1fb68911c000e0c /gdb/doc
parente88acd96184003169ba2c23cfd807243da100d72 (diff)
downloadfsf-binutils-gdb-7d74f2446c5ebad93f62426e285b64de882db843.zip
fsf-binutils-gdb-7d74f2446c5ebad93f62426e285b64de882db843.tar.gz
fsf-binutils-gdb-7d74f2446c5ebad93f62426e285b64de882db843.tar.bz2
* NEWS: Mention new python command class gdb.COMMAND_USER.
* cli/cli-cmds.c (show_user): Print error when used on a python command. (init_cli_cmds): Update documentation strings for "show user" and "set/show max-user-call-depth" to clarify that it does not apply to python commands. * python/py-cmd.c (cmdpy_init): Treat class_user as a valid class in error check. (gdbpy_initialize_commands): Add COMMAND_USER as a constant in gdb python api. * top.c (execute_command): Only execute a user-defined command as a legacy macro if c->user_commands is set. doc/ * gdb.texinfo (Commands In Python): Put example python macro in COMMAND_USER category rather than COMMAND_OBSCURE. Document gdb.COMMAND_USER. (User-defined Commands): Update documentation to clarify "set/show max-user-call-depth" and "show user" don't apply to python commands. Update documentation to clarify "help user-defined" may also include python commands defined as COMMAND_USER. testsuite/ * gdb.python/py-cmd.exp: Add test to verify that python commands can be put in the user-defined category and that the commands appear in "help user-defined".
Diffstat (limited to 'gdb/doc')
-rw-r--r--gdb/doc/ChangeLog10
-rw-r--r--gdb/doc/gdb.texinfo20
2 files changed, 26 insertions, 4 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 59bb285..18f47bd 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,13 @@
+2012-03-01 Scott J. Goldman <scottjg@vmware.com>
+
+ * gdb.texinfo (Commands In Python): Put example python macro in
+ COMMAND_USER category rather than COMMAND_OBSCURE.
+ Document gdb.COMMAND_USER.
+ (User-defined Commands): Update documentation to clarify
+ "set/show max-user-call-depth" and "show user" don't apply to python
+ commands. Update documentation to clarify "help user-defined" may
+ also include python commands defined as COMMAND_USER.
+
2012-02-25 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.texinfo (Startup): Add option -ex description to the option -x
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 88dcec1..6fd6158 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -21133,8 +21133,9 @@ command should not be repeated when the user hits @key{RET}
@kindex help user-defined
@item help user-defined
-List all user-defined commands, with the first line of the documentation
-(if any) for each.
+List all user-defined commands and all python commands defined in class
+COMAND_USER. The first line of the documentation or docstring is
+included (if any).
@kindex show user
@item show user
@@ -21142,6 +21143,7 @@ List all user-defined commands, with the first line of the documentation
Display the @value{GDBN} commands used to define @var{commandname} (but
not its documentation). If no @var{commandname} is given, display the
definitions for all user-defined commands.
+This does not work for user-defined python commands.
@cindex infinite recursion in user-defined commands
@kindex show max-user-call-depth
@@ -21151,6 +21153,7 @@ definitions for all user-defined commands.
The value of @code{max-user-call-depth} controls how many recursion
levels are allowed in user-defined commands before @value{GDBN} suspects an
infinite recursion and aborts the command.
+This does not apply to user-defined python commands.
@end table
In addition to the above commands, user-defined commands frequently
@@ -21951,7 +21954,7 @@ to handle this case. Example:
>class HelloWorld (gdb.Command):
> """Greet the whole world."""
> def __init__ (self):
-> super (HelloWorld, self).__init__ ("hello-world", gdb.COMMAND_OBSCURE)
+> super (HelloWorld, self).__init__ ("hello-world", gdb.COMMAND_USER)
> def invoke (self, args, from_tty):
> argv = gdb.string_to_argv (args)
> if len (argv) != 0:
@@ -23330,6 +23333,15 @@ The command has to do with tracepoints. For example, @code{trace},
@kbd{help tracepoints} at the @value{GDBN} prompt to see a list of
commands in this category.
+@findex COMMAND_USER
+@findex gdb.COMMAND_USER
+@item gdb.COMMAND_USER
+The command is a general purpose command for the user, and typically
+does not fit in one of the other categories.
+Type @kbd{help user-defined} at the @value{GDBN} prompt to see
+a list of commands in this category, as well as the list of gdb macros
+(@pxref{Sequences}).
+
@findex COMMAND_OBSCURE
@findex gdb.COMMAND_OBSCURE
@item gdb.COMMAND_OBSCURE
@@ -23391,7 +23403,7 @@ class HelloWorld (gdb.Command):
"""Greet the whole world."""
def __init__ (self):
- super (HelloWorld, self).__init__ ("hello-world", gdb.COMMAND_OBSCURE)
+ super (HelloWorld, self).__init__ ("hello-world", gdb.COMMAND_USER)
def invoke (self, arg, from_tty):
print "Hello, World!"