public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Keith Seitz <keiths@redhat.com>
To: gdb-patches@sourceware.org
Subject: [PATCH v2 03/18] Implement completion limiting for complete_on_cmdlist.
Date: Mon, 04 May 2015 19:18:00 -0000	[thread overview]
Message-ID: <20150504191814.20434.83624.stgit@valrhona.uglyboxes.com> (raw)
In-Reply-To: <20150504191734.20434.68053.stgit@valrhona.uglyboxes.com>

This is the first of a series of smaller patches to switch over
all completion functions to using maybe_add_completion to add
completions to the completion list to be presented to the user.

Note that in order to verify that this patch works as intended,
one must override the backup completion counting in complete_line.
[This backup code will be permanently removed in a later patch.]
During testing, I have verified all patches with this planned code
removal to verify that it works.

First up is complete_on_cmdlist.  Completion limiting is already tested
in gdb.base/completion.exp, so there are no new tests.

gdb/ChangeLog

	* cli/cli-decode.c (complete_on_cmdlist): Use add_completion
	to determine whether to continue looking for completions.
---
 gdb/cli/cli-decode.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
index 286fc61..011c427 100644
--- a/gdb/cli/cli-decode.c
+++ b/gdb/cli/cli-decode.c
@@ -1815,7 +1815,9 @@ complete_on_cmdlist (struct completer_data *cdata,
 		match[text - word] = '\0';
 		strcat (match, ptr->name);
 	      }
-	    VEC_safe_push (char_ptr, matchlist, match);
+	    if (add_completion (cdata, &matchlist, match)
+		== ADD_COMPLETION_MAX_REACHED)
+	      return matchlist;
 	  }
       /* If we saw no matching deprecated commands in the first pass,
 	 just bail out.  */

  parent reply	other threads:[~2015-05-04 19:18 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-04 19:18 [PATCH v2 00/18] Implement full completer limiting Keith Seitz
2015-05-04 19:18 ` [PATCH v2 15/18] Implement completion limiting for scmcmd_add_completion Keith Seitz
2015-05-04 19:18 ` [PATCH v2 10/18] Implement completion limiting for cmdpy_completer Keith Seitz
2015-05-04 19:18 ` [PATCH v2 07/18] Implement completion limiting for filename_completer Keith Seitz
2015-05-04 19:18 ` [PATCH v2 11/18] Implement completion limiting for reg_or_group_completer Keith Seitz
2015-05-04 19:18 ` [PATCH v2 02/18] Remove completion_tracker_t from the public completion API Keith Seitz
2015-05-04 19:18 ` [PATCH v2 06/18] Implement completion limiting for condition_completer Keith Seitz
2015-05-04 19:18 ` [PATCH v2 13/18] Implement completion limiting for complete_on_enum Keith Seitz
2015-05-04 19:18 ` [PATCH v2 08/18] Implement completion limiting for signal_completer Keith Seitz
2015-05-04 19:18 ` [PATCH v2 16/18] Make the completion API completely opaque Keith Seitz
2015-05-04 19:18 ` [PATCH v2 17/18] Use the hashtable to accumulate completion results Keith Seitz
2015-05-04 19:18 ` [PATCH v2 05/18] Implement completion limiting for ada_make_symbol_completion_list Keith Seitz
2015-05-04 19:18 ` Keith Seitz [this message]
2015-05-04 19:18 ` [PATCH v2 14/18] Implement completion limiting in add_struct_fields Keith Seitz
2015-05-04 19:18 ` [PATCH v2 01/18] Add struct completer_data to the completion API Keith Seitz
2015-05-04 19:18 ` [PATCH v2 04/18] Implement completion limiting for add_filename_to_list Keith Seitz
2015-05-04 19:18 ` [PATCH v2 09/18] Implement completion limiting for interpreter_completer Keith Seitz
2015-05-04 19:18 ` [PATCH v2 12/18] Implement completion limiting for sim_command_completer Keith Seitz
2015-05-04 19:19 ` [PATCH v2 18/18] Remove the vector return result from the completion API Keith Seitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150504191814.20434.83624.stgit@valrhona.uglyboxes.com \
    --to=keiths@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).