From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20304 invoked by alias); 27 Nov 2014 16:25:11 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 20284 invoked by uid 89); 27 Nov 2014 16:25:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: mtaout28.012.net.il Received: from mtaout28.012.net.il (HELO mtaout28.012.net.il) (80.179.55.184) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Nov 2014 16:25:08 +0000 Received: from conversion-daemon.mtaout28.012.net.il by mtaout28.012.net.il (HyperSendmail v2007.08) id <0NFP00100HG1YW00@mtaout28.012.net.il> for gdb-patches@sourceware.org; Thu, 27 Nov 2014 18:22:35 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout28.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NFP001MRHHNL500@mtaout28.012.net.il>; Thu, 27 Nov 2014 18:22:35 +0200 (IST) Date: Thu, 27 Nov 2014 16:25:00 -0000 From: Eli Zaretskii Subject: Re: [PATCH 3/3 v2] Implement completion limiting In-reply-to: <1417094168-25868-4-git-send-email-gbenson@redhat.com> To: Gary Benson Cc: gdb-patches@sourceware.org, xdje42@gmail.com Reply-to: Eli Zaretskii Message-id: <83d288obkc.fsf@gnu.org> References: <1417094168-25868-1-git-send-email-gbenson@redhat.com> <1417094168-25868-4-git-send-email-gbenson@redhat.com> X-IsSubscribed: yes X-SW-Source: 2014-11/txt/msg00692.txt.bz2 > From: Gary Benson > Cc: Doug Evans , Eli Zaretskii > Date: Thu, 27 Nov 2014 13:16:08 +0000 > > This commit adds a new exception, TOO_MANY_COMPLETIONS_ERROR, to be > thrown whenever the completer has generated too many candidates to > be useful. A new user-settable variable, "max_completions", is added > to control this behaviour. A top-level completion limit is added to > complete_line_internal, as the final check to ensure the user never > sees too many completions. An additional limit is added to > default_make_symbol_completion_list_break_on, to halt time-consuming > symbol table expansions. > > gdb/ChangeLog: > > PR cli/9007 > PR cli/11920 > PR cli/15548 > * common/common-exceptions.h (enum errors) > : New value. > * completer.h (completion_tracker_t): New typedef. > (new_completion_tracker): New declaration. > (make_cleanup_free_completion_tracker): Likewise. > (maybe_limit_completions): Likewise. > * completer.c [TUI]: Include tui/tui.h and tui/tui-io.h. > (max_completions): New static variable. > (new_completion_tracker): New function. > (make_cleanup_free_completion_tracker): Likewise. > (maybe_limit_completions): Likewise. > (complete_line_internal): Do not generate any completions if > max_completions = 0. Limit the number of completions if > max_completions >= 0. > (line_completion_function): Handle TOO_MANY_COMPLETIONS_ERROR. > (_initialize_completer): New declaration and function. > * symtab.c: Include completer.h. > (completion_tracker): New static variable. > (completion_list_add_name): Call maybe_limit_completions. > (default_make_symbol_completion_list_break_on): Maintain > completion_tracker across calls to completion_list_add_name. > * NEWS (New Options): Mention set/show max-completions. > > gdb/doc/ChangeLog: > > * gdb.texinfo (Command Completion): Document new > "set/show max-completions" option. OK for the documentation parts. Thanks.