aboutsummaryrefslogtreecommitdiff
path: root/gdb/doc
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/doc
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/doc')
-rw-r--r--gdb/doc/ChangeLog4
-rw-r--r--gdb/doc/gdb.texinfo8
2 files changed, 12 insertions, 0 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index a729066..f768eb2 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,7 @@
+2009-01-14 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * gdb.texinfo (Define, Hooks): Document prefix command support.
+
2009-01-14 Joseph Myers <joseph@codesourcery.com>
Carlos O'Donell <carlos@codesourcery.com>
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 817b96b..583d96c 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -17573,6 +17573,10 @@ end
@item define @var{commandname}
Define a command named @var{commandname}. If there is already a command
by that name, you are asked to confirm that you want to redefine it.
+@var{commandname} may be a bare command name consisting of letters,
+numbers, dashes, and underscores. It may also start with any predefined
+prefix command. For example, @samp{define target my-target} creates
+a user-defined @samp{target my-target} command.
The definition of the command is made up of other @value{GDBN} command lines,
which are given following the @code{define} command. The end of these
@@ -17707,6 +17711,10 @@ not for command aliases; you should define a hook for the basic command
name, e.g.@: @code{backtrace} rather than @code{bt}.
@c FIXME! So how does Joe User discover whether a command is an alias
@c or not?
+You can hook a multi-word command by adding @code{hook-} or
+@code{hookpost-} to the last word of the command, e.g.@:
+@samp{define target hook-remote} to add a hook to @samp{target remote}.
+
If an error occurs during the execution of your hook, execution of
@value{GDBN} commands stops and @value{GDBN} issues a prompt
(before the command that you actually typed had a chance to run).