diff options
author | Doug Evans <dje@google.com> | 2012-03-01 19:30:17 +0000 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2012-03-01 19:30:17 +0000 |
commit | 97c575f1e694776f4e5d7252321c7f89c6c40863 (patch) | |
tree | b2cdd70df422f25f597e40c14e24693173c9c6be /gdb/top.c | |
parent | ac55ab70cef76751d949f637dfbd28551a883bcb (diff) | |
download | gdb-97c575f1e694776f4e5d7252321c7f89c6c40863.tar.gz |
* 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/top.c')
-rw-r--r-- | gdb/top.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/top.c b/gdb/top.c index e41f56cf363..55e4504009a 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -470,7 +470,8 @@ execute_command (char *p, int from_tty) if (c->flags & DEPRECATED_WARN_USER) deprecated_cmd_warning (&line); - if (c->class == class_user) + /* c->user_commands would be NULL in the case of a python command. */ + if (c->class == class_user && c->user_commands) execute_user_command (c, arg); else if (c->type == set_cmd || c->type == show_cmd) do_setshow_command (arg, from_tty, c); |