From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id cN3qEg+lwWBUFwAAWB0awg (envelope-from ) for ; Thu, 10 Jun 2021 01:37:19 -0400 Received: by simark.ca (Postfix, from userid 112) id 4BB2F1F163; Thu, 10 Jun 2021 01:37:19 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 6AB051E813 for ; Thu, 10 Jun 2021 01:37:18 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 36AFE39B345E for ; Thu, 10 Jun 2021 05:37:18 +0000 (GMT) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id E438339B5C0D for ; Thu, 10 Jun 2021 05:37:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E438339B5C0D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from imap.suse.de (imap-alt.suse-dmz.suse.de [192.168.254.47]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 04D2C1FD60 for ; Thu, 10 Jun 2021 05:37:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1623303425; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=xVsA/VRS9ZRti8LASuooacEKQbpkG1YfNvOY1gJ4K2M=; b=DatzNtTFLKVZZXCSzFAr7SE9q7l5rpfMornN2jwUZu1bT1Q86/3uk0kVhAYP/1A98AvZRH PNN4R4Ka8+iw0ewKKa17hrOHiJJUmFsXxcG+vLT0DvGCHFQsdypKSGa1+UbsBhJu3lULjB ziatLfgxMPaJhp/AXRBAmp7dfkSHK1Q= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1623303425; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=xVsA/VRS9ZRti8LASuooacEKQbpkG1YfNvOY1gJ4K2M=; b=+IrODGHgfrl6M10kFIx3WXEArtUKcZlnsKb52PEcfXXJUUDrLcqUem5Sy+mL/bWrBEmmF1 RyRGKTGG4SbbcLAA== Received: from imap3-int (imap-alt.suse-dmz.suse.de [192.168.254.47]) by imap.suse.de (Postfix) with ESMTP id DC0F4118DD for ; Thu, 10 Jun 2021 05:37:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1623303424; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=xVsA/VRS9ZRti8LASuooacEKQbpkG1YfNvOY1gJ4K2M=; b=sdr9U1oK92/ceVNP+RVE/Szo5+skWLvRM6FW400sHhmKcybVVyNKL/g/9BkMmrEiB7s4TX pMVJykQ7i4Wd/O8/gv/I4PwCfMVqsuua7mVg42fGl44honO5QZjnaeLF1cIL7uC/k3KJ/9 EiZff9L6DII4yOzQTH1kwSfmu3eaLHI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1623303424; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=xVsA/VRS9ZRti8LASuooacEKQbpkG1YfNvOY1gJ4K2M=; b=UeoQSAomkbKJnN9gqSN+4KmeU52ezaz2G12Ls9VJtIFfRNAfm1tTaEAyg6T4JaK1Q5vHuH ibUclTKfdwcMreAQ== Received: from director2.suse.de ([192.168.254.72]) by imap3-int with ESMTPSA id THjLNAClwWD9SQAALh3uQQ (envelope-from ) for ; Thu, 10 Jun 2021 05:37:04 +0000 Date: Thu, 10 Jun 2021 07:37:03 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix gdb.cp/nested-types.exp with check-read1 Message-ID: <20210610053702.GA24260@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi, With check-read1 I occasionally run into: ... FAIL: gdb.cp/nested-types.exp: ptype S10 (limit = 7) \ // parse failed (timeout) ... I can trigger this reliably by running check-read1 in conjunction with stress -c 5. Fix this by breaking up the regexp in cp_test_ptype_class. Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix gdb.cp/nested-types.exp with check-read1 gdb/testsuite/ChangeLog: 2021-06-09 Tom de Vries * lib/cp-support.exp (cp_test_ptype_class): Break up regexp. * gdb.cp/nested-types.exp: Remove usage of read1 timeout factor. --- gdb/testsuite/gdb.cp/nested-types.exp | 11 ++--------- gdb/testsuite/lib/cp-support.exp | 36 ++++++++++++++++++++++++++--------- 2 files changed, 29 insertions(+), 18 deletions(-) diff --git a/gdb/testsuite/gdb.cp/nested-types.exp b/gdb/testsuite/gdb.cp/nested-types.exp index 155d915d574..a71339b233f 100644 --- a/gdb/testsuite/gdb.cp/nested-types.exp +++ b/gdb/testsuite/gdb.cp/nested-types.exp @@ -278,20 +278,13 @@ proc test_nested_limit {limit log} { node_result result 10 $limit {} 0 $log if {!$log} { - if {$limit < 0 || $limit >= 8 } { - set read1_timeout_factor 10 - } else { - set read1_timeout_factor 1 - } # The only output we check for is the contents of the struct, # ignoring the leading "type = struct S10 {" and trailing "}" of # the outermost node. set result [lindex $result 0] lassign $result type access key name children - with_read1_timeout_factor $read1_timeout_factor { - cp_test_ptype_class $name "ptype $name (limit = $limit)" $key \ - $name $children - } + cp_test_ptype_class $name "ptype $name (limit = $limit)" $key \ + $name $children } } diff --git a/gdb/testsuite/lib/cp-support.exp b/gdb/testsuite/lib/cp-support.exp index b188c904710..479ef079360 100644 --- a/gdb/testsuite/lib/cp-support.exp +++ b/gdb/testsuite/lib/cp-support.exp @@ -245,6 +245,7 @@ proc cp_test_ptype_class { in_exp in_testname in_key in_tag in_class_table { in_ptype_arg /r } { recursive_qid 0 } } { global gdb_prompt set wsopt "\[\r\n\t \]*" + set hwsopt "\[\t \]*" if {$recursive_qid == 0} { # The test name defaults to the command, but without the @@ -306,23 +307,40 @@ proc cp_test_ptype_class { in_exp in_testname in_key in_tag in_class_table "$in_tag\\((int|void|)\\);"] # Partial regexp for parsing the struct/class header. - set regexp_header "(struct|class)${wsopt}(\[^ \t\]*)${wsopt}" - append regexp_header "(\\\[with .*\\\]${wsopt})?((:\[^\{\]*)?)${wsopt}\{" + set regexp_header "(struct|class)${hwsopt}(\[^ \t\]*)${hwsopt}" + append regexp_header "(\\\[with .*\\\]${hwsopt})?((:\[^\{\]*)?)${hwsopt}\{" if {$recursive_qid == 0} { # Actually do the ptype. - # For processing the output of ptype, we must get to the prompt. - set the_regexp "type = ${regexp_header}" - append the_regexp "(.*)\}${wsopt}(\[^\r\n\]*)\[\r\n\]+$gdb_prompt $" set parse_okay 0 + set state 0 + set actual_body "" gdb_test_multiple "$in_command" "$in_testname // parse failed" { - -re $the_regexp { - set parse_okay 1 + -re "type = ${regexp_header}" { + if { $state == 0 } { set state 1 } else { set state -1 } set actual_key $expect_out(1,string) set actual_tag $expect_out(2,string) set actual_base_string $expect_out(4,string) - set actual_body $expect_out(6,string) - set actual_tail $expect_out(7,string) + exp_continue + } + -re "^\r\n\}${hwsopt}(\[^\r\n\]*)(?=\r\n)" { + if { $state == 1 } { set state 2 } else { set state -2 } + set actual_tail $expect_out(1,string) + exp_continue + } + -re "^\r\n(\[^\r\n\]*)(?=\r\n)" { + if { $state != 1 } { set $state -3 } + if { $actual_body == "" } { + set actual_body $expect_out(1,string) + } else { + append actual_body "\n$expect_out(1,string)" + } + exp_continue + } + -re -wrap "" { + if { $state == 2 } { + set parse_okay 1 + } } } } else {