This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH v2 0/2] MI: Add new command -complete
- From: Jan Vrany <jan dot vrany at fit dot cvut dot cz>
- To: gdb-patches at sourceware dot org
- Cc: Jan Vrany <jan dot vrany at fit dot cvut dot cz>
- Date: Mon, 28 Jan 2019 12:40:59 +0000
- Subject: [PATCH v2 0/2] MI: Add new command -complete
- References: <87imynm3ia.fsf@tromey.com>
This is a rework of previous patch based on Tom's comments.
Another thing worth considering (not done in this version) is to
have more structured result. Instead of (current version):
-complete "br m"
=^done,completions=["br main", "br madvise"]
respond with something like (proposed change):
-complete "br m"
=^done,text="br m",common="a",matches=["in", "dvise"]
The rarionale is that frontend most likely needs these three
values anyway to implement completion. It can, indeed compute
them from full list as returned now, but GDB has these values
already so it would save the frontend doing the same work again.
OTOH, current output is more on par with CLI command output.
What do you think?
Differences v1 -> v2:
* extracted common completion logic to a new helper function
* implemented MI command using a new mi-specific function rather
than using CLI implementation.
Jan Vrany (2):
MI: extract command completion logic from complete_command()
MI: Add new command -complete
gdb/ChangeLog | 14 ++++++
gdb/NEWS | 7 +++
gdb/cli/cli-cmds.c | 32 +------------
gdb/completer.c | 34 +++++++++++++
gdb/completer.h | 8 ++++
gdb/doc/ChangeLog | 5 ++
gdb/doc/gdb.texinfo | 31 ++++++++++++
gdb/mi/mi-cmds.c | 2 +
gdb/mi/mi-cmds.h | 1 +
gdb/mi/mi-main.c | 44 +++++++++++++++++
gdb/testsuite/ChangeLog | 4 ++
gdb/testsuite/gdb.mi/mi-complete.exp | 71 ++++++++++++++++++++++++++++
12 files changed, 223 insertions(+), 30 deletions(-)
create mode 100644 gdb/testsuite/gdb.mi/mi-complete.exp
--
2.20.1