aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli/cli-cmds.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2009-01-14 20:40:09 +0000
committerDaniel Jacobowitz <drow@false.org>2009-01-14 20:40:09 +0000
commitadb483feb8b53555613d1165a6c6de4bdc1a5160 (patch)
treee2c58af8524daf15debeb52548bfb3215718f54c /gdb/cli/cli-cmds.c
parenta32d7317c7ae58c986b499ad11028dbf49a15da1 (diff)
downloadgdb-adb483feb8b53555613d1165a6c6de4bdc1a5160.zip
gdb-adb483feb8b53555613d1165a6c6de4bdc1a5160.tar.gz
gdb-adb483feb8b53555613d1165a6c6de4bdc1a5160.tar.bz2
* NEWS: Document "define" for prefixed commands.
* cli/cli-cmds.c (show_user): Update calls to show_user_1. Call show_user_1 for prefix commands. * cli/cli-decode.c (help_cmd_list): Recurse for "help user-defined". * cli/cli-script.c (validate_comname): Rewrite to handle prefix commands. Return the containing command list. (define_command, document_command): Update to handle prefix commands. (show_user_1): Add prefix and name arguments. Handle prefix commands. * cli/cli-script.h (show_user_1): Update prototype. doc/ * gdb.texinfo (Define, Hooks): Document prefix command support. testsuite/ * gdb.base/define.exp: Test defining and hooking prefix commands. * gdb.python/python.exp: Update test for "show user" output.
Diffstat (limited to 'gdb/cli/cli-cmds.c')
-rw-r--r--gdb/cli/cli-cmds.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index d3694e4..4d9c4f3 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -1050,17 +1050,18 @@ show_user (char *args, int from_tty)
if (args)
{
- c = lookup_cmd (&args, cmdlist, "", 0, 1);
+ char *comname = args;
+ c = lookup_cmd (&comname, cmdlist, "", 0, 1);
if (c->class != class_user)
error (_("Not a user command."));
- show_user_1 (c, gdb_stdout);
+ show_user_1 (c, "", args, gdb_stdout);
}
else
{
for (c = cmdlist; c; c = c->next)
{
- if (c->class == class_user)
- show_user_1 (c, gdb_stdout);
+ if (c->class == class_user || c->prefixlist != NULL)
+ show_user_1 (c, "", c->name, gdb_stdout);
}
}
}