From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 116619 invoked by alias); 12 Apr 2018 23:40:55 -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 116610 invoked by uid 89); 12 Apr 2018 23:40:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=heading, bump, Hx-languages-length:1233, slowing X-HELO: 9pmail.ess.barracuda.com Received: from 9pmail.ess.barracuda.com (HELO 9pmail.ess.barracuda.com) (64.235.150.224) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 12 Apr 2018 23:40:52 +0000 Received: from mipsdag02.mipstec.com (mail2.mips.com [12.201.5.32]) by mx4.ess.sfj.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=NO); Thu, 12 Apr 2018 23:40:48 +0000 Received: from [10.20.78.219] (10.20.78.219) by mipsdag02.mipstec.com (10.20.40.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1415.2; Thu, 12 Apr 2018 16:41:02 -0700 Date: Thu, 12 Apr 2018 23:40:00 -0000 From: "Maciej W. Rozycki" To: Andrew Burgess CC: Subject: Re: [PATCH 3/3] gdb/testsuite: Handle targets with lots of registers In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-ClientProxiedBy: mipsdag02.mipstec.com (10.20.40.47) To mipsdag02.mipstec.com (10.20.40.47) X-BESS-ID: 1523576447-298555-20859-12446-1 X-BESS-VER: 2018.4-r1804121647 X-BESS-Apparent-Source-IP: 12.201.5.32 X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.191935 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.00 using account:ESS59374 scores of KILL_LEVEL=7.0 tests=BSF_BESS_OUTBOUND X-BESS-BRTS-Status:1 X-SW-Source: 2018-04/txt/msg00246.txt.bz2 On Mon, 9 Apr 2018, Andrew Burgess wrote: > # Test for a regression where this command would internal-error if the > -# program wasn't running. > -gdb_test "maint print registers" "Name.*Nr.*Rel.*Offset.*Size.*Type.*" > +# program wasn't running. If there's a lot of registers then this > +# might overflow expect's buffers, so process the output line at a > +# time. > +send_gdb "maint print registers\n" > +gdb_expect { > + -re "^\[^\n\r\]+\[0-9\]+\[^\n\r\]+\[0-9\]+\[^\n\r\]+\[0-9\]+\[^\n\r\]+\[0-9\]+\[^\n\r\]+\[\n\r\]+" { > + exp_continue > + } I think this changes the meaning of the test; you want to preserve the heading match pattern at the very least. Also `gdb_test' handles various error cases gracefully (which matters for the avoidance of excessive timeouts with some test boards), whereas your simple matcher does not. Also how many is "a lot"? Perhaps you could take the path of least resistance instead and simply increase the size of the buffer, like with commit ff604a674771 ("gdb/testsuite: Bump up `match_max'"). This could be done temporarily for this test only, so as to avoid slowing down `expect' throughout the test suite. Maciej