From patchwork Thu Jan 4 08:35:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Brobecker X-Patchwork-Id: 25206 Received: (qmail 3354 invoked by alias); 4 Jan 2018 08:36:12 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 3105 invoked by uid 89); 4 Jan 2018 08:36:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 04 Jan 2018 08:36:00 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id DE1BA1176E1 for ; Thu, 4 Jan 2018 03:35:58 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id gLDN1bXFjOri for ; Thu, 4 Jan 2018 03:35:58 -0500 (EST) Received: from tron.gnat.com (tron.gnat.com [205.232.38.10]) by rock.gnat.com (Postfix) with ESMTP id CFB5E116E2E for ; Thu, 4 Jan 2018 03:35:58 -0500 (EST) Received: by tron.gnat.com (Postfix, from userid 4233) id CCE6448A; Thu, 4 Jan 2018 03:35:58 -0500 (EST) From: Joel Brobecker To: gdb-patches@sourceware.org Subject: [PATCH 2/3] Add "complete break ada" test to gdb.ada/complete.exp Date: Thu, 4 Jan 2018 03:35:52 -0500 Message-Id: <1515054953-81012-3-git-send-email-brobecker@adacore.com> In-Reply-To: <1515054953-81012-1-git-send-email-brobecker@adacore.com> References: <1515054953-81012-1-git-send-email-brobecker@adacore.com> This patch adds a new test to demonstrate a regression introduced by: commit b5ec771e60c1a0863e51eb491c85c674097e9e13 Date: Wed Nov 8 14:22:32 2017 +0000 Subject: Introduce lookup_name_info and generalize Ada's FULL/WILD name matching The original purpose of the new test is to exercise the "complete" command with an expression for which a large number of matches are returned and to verify that each match returned is a plausible match. In this particular case, the commit above causes GDB to generate additional matches which should in fact not appear in the list (internally generated symbols, or symbols that should be enclosed between "<...>"). These extraneous entries are easy to spot, because they have uppercase characters, such as: break ada__stringsS break ada__strings__R11s [etc] For now, the new test is KFAIL'ed, to avoid generating a new FAIL while we work on fixing that regression. gdb/testsuite/ChangeLog: PR gdb/22670 * gdb.ada/complete.exp: Add "complete break ada" test. Tested on x86_64-linux with GDB built before and after the patch that caused the regression (b5ec771e60c1a0863e51eb491c85c674097e9e13). The test passes before the regression, and generates a KFAIL after. --- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/gdb.ada/complete.exp | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index b1be7e3..a81f9da 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,6 +1,11 @@ 2018-01-04 Joel Brobecker PR gdb/22670 + * gdb.ada/complete.exp: Add "complete break ada" test. + +2018-01-04 Joel Brobecker + + PR gdb/22670 * gdb.ada/info_addr_mixed_case: New testcase. 2018-01-03 Xavier Roirand diff --git a/gdb/testsuite/gdb.ada/complete.exp b/gdb/testsuite/gdb.ada/complete.exp index 9b64d15..c1f22c2 100644 --- a/gdb/testsuite/gdb.ada/complete.exp +++ b/gdb/testsuite/gdb.ada/complete.exp @@ -204,3 +204,24 @@ test_gdb_complete "ambiguous_f" \ "p ambiguous_func" test_gdb_complete "ambiguous_func" \ "p ambiguous_func" + +# Perform a test intented to verify the behavior where the number +# of possible completions is very large. The goal is not to verify +# precisely the list returned by the complete command (this depends +# on too many parameters -- targets, compiler version, runtime, etc). +# However, we want to sanity-check each one of them, knowing that +# each result should start with "break ada" and that the proposed +# completion should look like a valid symbol name (in particular, +# no uppercase letters...). + +gdb_test_no_output "set max-completions unlimited" + +set test "complete break ada" +gdb_test_multiple "$test" $test { + -re "^$test$eol\(break ada(\[a-z0-9._\])*$eol\)+$gdb_prompt $" { + pass $test + } + -re "\[A-Z\].*$gdb_prompt $" { + kfail gdb/22670 $test + } +}