From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10519 invoked by alias); 7 Aug 2015 02:37:29 -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 10487 invoked by uid 89); 7 Aug 2015 02:37:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.6 required=5.0 tests=AWL,BAYES_40,DATE_IN_PAST_06_12,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 07 Aug 2015 02:37:25 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 2BFC3935A4 for ; Fri, 7 Aug 2015 02:37:23 +0000 (UTC) Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t76JETVL009343 for ; Thu, 6 Aug 2015 15:14:29 -0400 Subject: [PATCH v3 00/19] New completer API From: Keith Seitz To: gdb-patches@sourceware.org Date: Fri, 07 Aug 2015 02:37:00 -0000 Message-ID: <20150806191404.32159.50755.stgit@valrhona.uglyboxes.com> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg00192.txt.bz2 This series (v3) of patches contains numerous little fixes, plus two major additions: 1) Since v2, new TUI completion functions have been introduced. These have been updated/converted to the new API. 2) Many completion functions used to do a "partial copy" of the matching text. This oft-repeated code has been removed from all the completion functions and incorporated internally to the API. --- Currently completer functions are not required to implement completion- limiting. These functions will compute all possible completions and then rely on complete_line to limit the result. The main goal of this patchset is to require completer functions to implement proper completion-limiting using maybe_add_completion. This actually cleans up the completer API significantly and fixes at least one serious bug (an assertion failure, gdb/17960). The new API requires all completions to be added to the completion list using maybe_add_completion: void my_completer_function (struct completer_data *cdata, struct cmd_list_element *cmd, const char *text, const char *word) { while (/* there are more completions to look for */) { char *match = xstrdup (a_completion_match); if (add_completion (cdata, match, text /* or NULL */, word /* or NULL */)) == ADD_COMPLETION_MAX_REACHED) return; } } All patches have been regression tested for buildbot. --- Keith Seitz (19): Add struct completer_data to the completion API. Remove completion_tracker_t from the public completion API. Implement completion-limiting for complete_on_cmdlist. Implement completion limiting for add_filename_to_list. Implement completion limiting for ada_make_symbol_completion_list. Implement completion limiting for condition_completer. Implement completion limiting for filename_completer. Implement completion limiting for signal_completer. Implement completion limiting for interpreter_completer. Implement completion limiting for cmdpy_completer. Implement completion limiting for reg_or_group_completer. Implement completion limiting for sim_command_completer. Implement completion limiting for complete_on_enum. Implement completion limiting in add_struct_fields. Implement completion limiting for scmcmd_add_completion. Implement completion limiting for tui_reggroup_completer. Make the completion API completely opaque. Use the hashtable to accumulate completion results. Remove the vector return result from the completion API. gdb/ada-lang.c | 85 ++-- gdb/break-catch-syscall.c | 11 - gdb/breakpoint.c | 22 + gdb/cli/cli-cmds.c | 4 gdb/cli/cli-decode.c | 75 +--- gdb/command.h | 17 + gdb/completer.c | 537 +++++++++++++++++----------- gdb/completer.h | 115 +++--- gdb/corefile.c | 7 gdb/cp-abi.c | 7 gdb/f-lang.c | 8 gdb/guile/scm-cmd.c | 34 +- gdb/infrun.c | 15 - gdb/interps.c | 29 -- gdb/language.h | 8 gdb/python/py-cmd.c | 29 +- gdb/remote-sim.c | 18 + gdb/symtab.c | 304 ++++++---------- gdb/symtab.h | 47 +- gdb/testsuite/gdb.ada/complete.exp | 144 +++++++- gdb/testsuite/gdb.ada/complete/foo.adb | 4 gdb/testsuite/gdb.ada/complete/pck.ads | 12 + gdb/testsuite/gdb.base/break.c | 14 + gdb/testsuite/gdb.base/break.exp | 4 gdb/testsuite/gdb.base/completion.exp | 215 +++++++++++ gdb/testsuite/gdb.base/condbreak.exp | 70 ++++ gdb/testsuite/gdb.base/filesym.c | 4 gdb/testsuite/gdb.base/filesym.exp | 84 ++++ gdb/testsuite/gdb.base/filesym2.c | 24 + gdb/testsuite/gdb.base/filesym3.c | 24 + gdb/testsuite/gdb.base/filesym4.c | 24 + gdb/testsuite/gdb.base/filesym5.c | 22 + gdb/testsuite/gdb.cp/cpcompletion.exp | 55 +++ gdb/testsuite/gdb.cp/pr9594.cc | 28 + gdb/testsuite/gdb.guile/scm-cmd.exp | 24 + gdb/testsuite/gdb.python/py-completion.exp | 45 ++ gdb/tui/tui-layout.c | 7 gdb/tui/tui-regs.c | 16 - gdb/tui/tui-win.c | 28 + gdb/value.c | 14 - gdb/value.h | 3 41 files changed, 1496 insertions(+), 741 deletions(-) create mode 100644 gdb/testsuite/gdb.base/filesym2.c create mode 100644 gdb/testsuite/gdb.base/filesym3.c create mode 100644 gdb/testsuite/gdb.base/filesym4.c create mode 100644 gdb/testsuite/gdb.base/filesym5.c