]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Document define-prefix command and the use of . in command names.
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sat, 28 Sep 2019 17:30:08 +0000 (19:30 +0200)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sat, 30 Nov 2019 08:38:37 +0000 (09:38 +0100)
gdb/ChangeLog
2019-11-30  Philippe Waroquiers  <philippe.waroquiers@skynet.be>
* NEWS:  Mention define-prefix.  Tell that command names can now
contain a . character.

gdb/doc/ChangeLog
2019-11-30  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

* gdb.texinfo (Define): Indicate that user-defined prefix can
be used in 'define' command.  Document 'define-prefix' command.

gdb/ChangeLog
gdb/NEWS
gdb/doc/ChangeLog
gdb/doc/gdb.texinfo

index 50de35d07a97857a9d83d90646515eab541643c7..96efdb0f40dad38393b14d3267221316c54cd015 100644 (file)
@@ -1,3 +1,7 @@
+2019-11-30  Philippe Waroquiers  <philippe.waroquiers@skynet.be>
+       * NEWS:  Mention define-prefix.  Tell that command names can now
+       contain a . character.
+
 2019-11-30  Philippe Waroquiers  <philippe.waroquiers@skynet.be>
 
        * command.h (valid_cmd_char_p): Declare.
index d9014075b46bd6b8988d896c0e59653a8551a9a7..e477986d5f57284ab5494f09bca0fb4a6bd4a94b 100644 (file)
--- a/gdb/NEWS
+++ b/gdb/NEWS
   provide the exitcode or exit status of the shell commands launched by
   GDB commands such as "shell", "pipe" and "make".
 
+* The command define-prefix can now define user defined prefix commands.
+  User defined commands can now be defined using these user defined prefix
+  commands.
+
+* Command names can now use the . character.
+
 * The RX port now supports XML target descriptions.
 
 * GDB now shows the Ada task names at more places, e.g. in task switching
@@ -100,6 +106,9 @@ pipe -d DELIM COMMAND DELIM SHELL_COMMAND
   With no COMMAND, repeat the last executed command
   and send its output to SHELL_COMMAND.
 
+define-prefix COMMAND
+  Define or mark a command as a user-defined prefix command.
+  
 with SETTING [VALUE] [-- COMMAND]
 w SETTING [VALUE] [-- COMMAND]
   Temporarily set SETTING, run COMMAND, and restore SETTING.
index 288953826b9092bcbe441af7eb38fd7e659e5904..aaac75a50c1e86d3a4a7cf9a4551f43267ca724a 100644 (file)
@@ -1,3 +1,8 @@
+2019-11-30  Philippe Waroquiers  <philippe.waroquiers@skynet.be>
+
+       * gdb.texinfo (Define): Indicate that user-defined prefix can
+       be used in 'define' command.  Document 'define-prefix' command.
+
 2019-11-27  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * doc/gdb.texinfo (GDB/MI Symbol Query): Document new MI command
index 478c95b643e5e6277e887a745161df5b354b4990..2c30ea657e6aab8715d9b175ed99ab69ebce138e 100644 (file)
@@ -26525,8 +26525,9 @@ end
 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.
 The argument @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
+numbers, dashes, dots, and underscores.  It may also start with any
+predefined or user-defined 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,
@@ -26547,6 +26548,46 @@ You may use the @code{document} command again to change the
 documentation of a command.  Redefining the command with @code{define}
 does not change the documentation.
 
+@kindex define-prefix
+@item define-prefix @var{commandname}
+Define or mark the command @var{commandname} as a user-defined prefix
+command.  Once marked, @var{commandname} can be used as prefix command
+by the  @code{define} command.
+Note that @code{define-prefix} can be used with a not yet defined
+@var{commandname}.  In such a case, @var{commandname} is defined as
+an empty user-defined command.
+In case you redefine a command that was marked as a user-defined
+prefix command, the subcommands of the redefined command are kept
+(and @value{GDBN} indicates so to the user).
+
+Example:
+@example
+(gdb) define-prefix abc
+(gdb) define-prefix abc def
+(gdb) define abc def
+Type commands for definition of "abc def".
+End with a line saying just "end".
+>echo command initial def\n
+>end
+(gdb) define abc def ghi
+Type commands for definition of "abc def ghi".
+End with a line saying just "end".
+>echo command ghi\n
+>end
+(gdb) define abc def
+Keeping subcommands of prefix command "def".
+Redefine command "def"? (y or n) y
+Type commands for definition of "abc def".
+End with a line saying just "end".
+>echo command def\n
+>end
+(gdb) abc def ghi
+command ghi
+(gdb) abc def
+command def
+(gdb)
+@end example
+
 @kindex dont-repeat
 @cindex don't repeat command
 @item dont-repeat