diff options
author | Maciej W. Rozycki <macro@embecosm.com> | 2022-06-30 19:57:34 +0100 |
---|---|---|
committer | Maciej W. Rozycki <macro@embecosm.com> | 2022-06-30 19:57:34 +0100 |
commit | 89555e4ec2195b7b10203befa23ff5e62fba406d (patch) | |
tree | 2c7b5303e39d5f76fe5e3f6e1548958d4e9cb448 /gdb/doc | |
parent | 0b1505c82dc5bb593608bb72c1db0496088f2d25 (diff) | |
download | gdb-89555e4ec2195b7b10203befa23ff5e62fba406d.zip gdb-89555e4ec2195b7b10203befa23ff5e62fba406d.tar.gz gdb-89555e4ec2195b7b10203befa23ff5e62fba406d.tar.bz2 |
GDB: Add `NUMBER' completion to `set' integer commands
Fix a completion consistency issue with `set' commands accepting integer
values and the special `unlimited' keyword:
(gdb) complete print -elements
print -elements NUMBER
print -elements unlimited
(gdb)
vs:
(gdb) complete set print elements
set print elements unlimited
(gdb)
(there is a space entered at the end of both commands, not shown here)
which also means if you strike <Tab> with `set print elements ' input,
it will, annoyingly, complete to `set print elements unlimited' right
away rather than showing a choice between `NUMBER' and `unlimited'.
Add `NUMBER' then as an available completion for such `set' commands:
(gdb) complete set print elements
set print elements NUMBER
set print elements unlimited
(gdb)
Adjust the testsuite accordingly. Also document the feature in the
Completion section of the manual in addition to the Command Options
section already there.
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/gdb.texinfo | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 39c49f2..f7b02c2 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -1960,6 +1960,21 @@ After displaying the available possibilities, @value{GDBN} copies your partial input (@samp{b make_} in the example) so you can finish the command. +If the command you are trying to complete expects either a keyword or a +number to follow, then @samp{NUMBER} will be shown among the available +completions, for example: + +@smallexample +(@value{GDBP}) print -elements @key{TAB}@key{TAB} +NUMBER unlimited +(@value{GDBP}) print -elements@tie{} +@end smallexample + +@noindent +Here, the option expects a number (e.g., @code{100}), not literal +@code{NUMBER}. Such metasyntactical arguments are always presented in +uppercase. + If you just want to see the list of alternatives in the first place, you can press @kbd{M-?} rather than pressing @key{TAB} twice. @kbd{M-?} means @kbd{@key{META} ?}. You can type this either by holding down a |