From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 72424 invoked by alias); 17 Sep 2015 18:50:25 -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 72402 invoked by uid 89); 17 Sep 2015 18:50:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD 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; Thu, 17 Sep 2015 18:50:23 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 33624C0A1486; Thu, 17 Sep 2015 18:50:22 +0000 (UTC) Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t8HIoLQu014129 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 17 Sep 2015 14:50:21 -0400 Subject: Re: [patch, testsuite] require readline for gdb.linespec/explicit.exp tab-completion tests To: Sandra Loosemore , gdb-patches References: <55FA6B97.4080209@codesourcery.com> From: Keith Seitz X-Enigmail-Draft-Status: N1110 Message-ID: <55FB0B6C.6010401@redhat.com> Date: Thu, 17 Sep 2015 18:50:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <55FA6B97.4080209@codesourcery.com> Content-Type: multipart/mixed; boundary="------------030207000804000100010602" X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg00429.txt.bz2 This is a multi-part message in MIME format. --------------030207000804000100010602 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Content-length: 1876 On 09/17/2015 12:28 AM, Sandra Loosemore wrote: > Tab-completion tests require readline support. The ones in > gdb.base/completion.exp are already conditional, but the recently-added > gdb.linespec/explicit.exp tests are not. This patch fixes that, and > also an obvious typo ("faill" -> "fail"). The patch is kind of long > because I had to insert an "if" block and reindent, but there's nothing > else going on here. OK to commit? I'm not a maintainer, but I wouldn't hesitate to commit this as obvious. Thank you for catching (and fixing) that. > The immediate problem is that the response to the "break -function > mai\t" test doesn't always include the ^G character in the output > pattern, and the other FAILs are cascading off of the testcase not being > structured to recover from a pattern match failure (it's sending more > commands without a newline to terminate the one that failed). But, I > have no clue why GDB is giving a ^G in some configurations and not > others (I observed that this test fails on nios2-elf target but passes > on nios2-linux-gnu, for instance), or whether this difference is > indicative of an actual bug. So I've not touched that part of the > testcase. Can you reliably reproduce the failure? I have been unable to do so locally, but I have a couple of guesses why this test might fail. I've attached a patch where I've made two changes. First, I've switched from using "main" as a unique completion to some goofy new function where the name is hopefully truly unique. Second I believe the test is incorrect (or at least in combination with some readline versions?). ^G is output only for non-unique completions. So with this particular test, I don't think it should be present at all. I've removed it in the patch. If you can reliably reproduce the failure, I sure would love to know whether this patch helps at all. Keith --------------030207000804000100010602 Content-Type: text/x-patch; name="explicit.exp-unique-function.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="explicit.exp-unique-function.patch" Content-length: 1603 diff --git a/gdb/testsuite/gdb.linespec/explicit.c b/gdb/testsuite/gdb.line= spec/explicit.c index 4e1c635..5b65311 100644 --- a/gdb/testsuite/gdb.linespec/explicit.c +++ b/gdb/testsuite/gdb.linespec/explicit.c @@ -1,6 +1,6 @@ /* This testcase is part of GDB, the GNU debugger. =20 - Copyright 2012-2013 Free Software Foundation, Inc. + Copyright 2012-2015 Free Software Foundation, Inc. =20 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -42,6 +42,12 @@ myfunction (int arg) return r; } =20 +static int +explicit_exp_really_unique_function_name (int arg) +{ + return arg; +} + int main (void) { @@ -52,5 +58,5 @@ main (void) for (i =3D 0, j =3D 0; i < 1000; ++i) j +=3D myfunction (0); =20 - return myfunction2 (j); + return explicit_exp_really_unique_function_name (myfunction2 (j)); } diff --git a/gdb/testsuite/gdb.linespec/explicit.exp b/gdb/testsuite/gdb.li= nespec/explicit.exp index a0851cd..6b9c8e0 100644 --- a/gdb/testsuite/gdb.linespec/explicit.exp +++ b/gdb/testsuite/gdb.linespec/explicit.exp @@ -181,9 +181,9 @@ namespace eval $testfile { } =20 set tst "complete unique function name" - send_gdb "break -function mai\t" + send_gdb "break -function explicit_exp_really_unique_f\t" gdb_test_multiple "" $tst { - "break -function mai\\\x07n" { + "break -function explicit_exp_really_unique_function_name " { send_gdb "\n" gdb_test "" ".*Breakpoint \[0-9\]+.*" $tst gdb_test_no_output "delete \$bpnum" "delete $tst breakpoint" --------------030207000804000100010602--