aboutsummaryrefslogtreecommitdiff
path: root/gdb/doc
diff options
context:
space:
mode:
authorJan Vrany <jan.vrany@fit.cvut.cz>2019-05-17 10:58:23 +0100
committerJan Vrany <jan.vrany@fit.cvut.cz>2019-05-17 10:58:23 +0100
commit26648588294d039fcf1efbf512d785753cb6286d (patch)
tree3a2635afa20d8e731d56ad29feb8f23100e0feda /gdb/doc
parent6e035501e15e72398fcd9db88c97dd30e585a9ae (diff)
downloadgdb-26648588294d039fcf1efbf512d785753cb6286d.zip
gdb-26648588294d039fcf1efbf512d785753cb6286d.tar.gz
gdb-26648588294d039fcf1efbf512d785753cb6286d.tar.bz2
MI: Add new command -complete
There is a CLI command 'complete' intended to use with emacs. Such a command would also be useful for MI frontends, when separate CLI and MI channels cannot be used. For example, on Windows (because of lack of PTYs) or when GDB is used through SSH session. This commit adds a new '-complete' MI command. gdb/Changelog: 2019-01-28 Jan Vrany <jan.vrany@fit.cvut.cz> * mi/mi-cmds.h (mi_cmd_complete): New function. * mi/mi-main.c (mi_cmd_complete): Likewise. * mi/mi-cmds.c: Define new MI command -complete. * NEWS: Mention new -complete command. gdb/doc/ChangeLog: 2019-01-28 Jan Vrany <jan.vrany@fit.cvut.cz> * gdb.texinfo (Miscellaneous GDB/MI Commands): Document new MI command -complete. gdb/testsuite/ChangeLog: 2019-01-28 Jan Vrany <jan.vrany@fit.cvut.cz> * gdb.mi/mi-complete.exp: New file. * gdb.mi/mi-complete.cc: Likewise.
Diffstat (limited to 'gdb/doc')
-rw-r--r--gdb/doc/ChangeLog5
-rw-r--r--gdb/doc/gdb.texinfo65
2 files changed, 70 insertions, 0 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index 4ea3250..55dab15 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,8 @@
+2019-01-28 Jan Vrany <jan.vrany@fit.cvut.cz>
+
+ * gdb.texinfo (Miscellaneous GDB/MI Commands): Document new
+ MI command -complete.
+
2019-05-14 Tom de Vries <tdevries@suse.de>
* gdb.texinfo (Automatic symbol index cache): Add concept and command
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 328d510..37e2f14 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -34538,6 +34538,71 @@ fullname="/home/nickrob/myprog.c",line="73",arch="i386:x86_64"@}
(gdb)
@end smallexample
+@subheading The @code{-complete} Command
+@findex -complete
+
+@subheading Synopsis
+
+@smallexample
+-complete @var{command}
+@end smallexample
+
+Show a list of completions for partially typed CLI @var{command}.
+
+This command is intended for @sc{gdb/mi} frontends that cannot use two separate
+CLI and MI channels - for example: because of lack of PTYs like on Windows or
+because @value{GDBN} is used remotely via a SSH connection.
+
+@subheading Result
+
+The result consists of two or three fields:
+
+@table @samp
+@item completion
+This field contains the completed @var{command}. If @var{command}
+has no known completions, this field is omitted.
+
+@item matches
+This field contains a (possibly empty) array of matches. It is always present.
+
+@item max_completions_reached
+This field contains @code{1} if number of known completions is above
+@code{max-completions} limit (see @ref{Completion}), otherwise it contains
+@code{0}. It is always present.
+
+@end table
+
+@subheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{complete}.
+
+@subheading Example
+
+@smallexample
+(gdb)
+-complete br
+^done,completion="break",
+ matches=["break","break-range"],
+ max_completions_reached="0"
+(gdb)
+-complete "b ma"
+^done,completion="b ma",
+ matches=["b madvise","b main"],max_completions_reached="0"
+(gdb)
+-complete "b push_b"
+^done,completion="b push_back(",
+ matches=[
+ "b A::push_back(void*)",
+ "b std::string::push_back(char)",
+ "b std::vector<int, std::allocator<int> >::push_back(int&&)"],
+ max_completions_reached="0"
+(gdb)
+-complete "nonexist"
+^done,matches=[],max_completions_reached="0"
+(gdb)
+
+@end smallexample
+
@node Annotations
@chapter @value{GDBN} Annotations