From patchwork Wed Nov 29 17:55:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 80976 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D1E41385B534 for ; Wed, 29 Nov 2023 17:56:06 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id C6B53385840C for ; Wed, 29 Nov 2023 17:55:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C6B53385840C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C6B53385840C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701280553; cv=none; b=mfZtHZ2jYqao+dNHPG/8lzDvzD6o2lCwSqDLdl6CDEm5Rt53+LaoHS2MicXGrB9CbC2DC10S/l09nfeNYYTGT6ShR359HjuhjMTj+WaeEPmMfFMNrvS0uSiMSKxYI3yyBhPlNv/u68gOW6HXe2kjO1i+uMubZAWRCe/zy6fsQ1w= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701280553; c=relaxed/simple; bh=BGfOOQ93tZewD90eNqp6SbzCpBQiB2BV+5hK/vtyetA=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=ObzLkHyz7r9yfqqpcbbEi4q//wL034OhmSNardpdGQNuFzlKIK0dKS6APxuPUDGgx93xwotJMvL7RHL/Vq1i7d2jwd95WotADTTY4mU4zeLt6r3xjIjX2qLXeuXCBjNZ/FpsIkaLsFtc1I+f0+v5L2RQ9k95gTmc4kfbJnDxwaY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701280551; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bsZWXsZ8WfwTc+yrQgpfj1BIeByMX/WVaZa9Lm1kQHk=; b=d81qzI3PZzv0okIHisHr1cTVWRn5kPQu01r4iMA70BSmdpyheiaoGmv2q3VaEYUtg6c7Va PEaE4TBfSZ8OL8pm9TL2o6AE4ioPlu+vMDjjptFvpe2wIApaItk6PmzHOyKVukWqHdwlgR TsyM597/gUB39FxlwXC79t1OHK5ZEWs= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-650-nkTjoC0MPeC0nIt2PMhcLA-1; Wed, 29 Nov 2023 12:55:49 -0500 X-MC-Unique: nkTjoC0MPeC0nIt2PMhcLA-1 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-332fab597afso52906f8f.3 for ; Wed, 29 Nov 2023 09:55:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701280548; x=1701885348; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bsZWXsZ8WfwTc+yrQgpfj1BIeByMX/WVaZa9Lm1kQHk=; b=wFNkWC23iK1i1Ecnk2Hg5goZI0j1ZOUMtkXGE8NVNF/v4tsSc0B0wC4ID/avFyM0yW /cbRh6DAOIR0cKw0DIG6xDRdNpJ9gRPhOEXjq1eQvMn+RVONc5vzSrcHYOE7lpUotklw FCtk50xgtIjOyo8sar9IEHmn9cvrIvxHH3H1SOQGml6NDKrXeS4iIMlGj+bO3t3dgNt5 CrIWGSk6S5cpm+mY+Pn7YXQJ0C1l1FVvSxCSfcxAwdoG6p3bmk03NkgK8hF1ouFtD5aa SxNCFp23gFw+MBlZvO3mBwu7rmoPfkNBC66YL7J9R1baQN3SKHI6p4URJwmdmr9ctfYd nf8Q== X-Gm-Message-State: AOJu0YwFAD0z1Wsf+fU3xyATnVny+jEB+twpdtZgYUcnhKYZEFZBNbxO SKaYEfiPcqF8S0z9Y5QecB0eKYbHk4O2ctnW0+DQUHdOzfnvXE34FMCPPb31fQFQLwIofSByFyu mbSV7vs/R+F4VA8A5LqvSDA2ZUsrICJO8lpqDWITDaWtDOQRG9ZWWwzvXxo3gZqpC+tZfbLOsk7 LK4twbmQ== X-Received: by 2002:adf:e38e:0:b0:32f:6fc3:7963 with SMTP id e14-20020adfe38e000000b0032f6fc37963mr13611254wrm.15.1701280548582; Wed, 29 Nov 2023 09:55:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IFOAtLR9jtuguCtd+QIdqEmkzziGN2GPizT9zdf5Kqj2eiFCIELhHYnrHqIi8xqyBeSvXa8tA== X-Received: by 2002:adf:e38e:0:b0:32f:6fc3:7963 with SMTP id e14-20020adfe38e000000b0032f6fc37963mr13611242wrm.15.1701280548368; Wed, 29 Nov 2023 09:55:48 -0800 (PST) Received: from localhost (105.226.159.143.dyn.plus.net. [143.159.226.105]) by smtp.gmail.com with ESMTPSA id m23-20020a056000025700b00326dd5486dcsm18424536wrz.107.2023.11.29.09.55.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 09:55:48 -0800 (PST) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH 1/2] gdb/testsuite: fix gdb.ada/complete.exp timeout in READ1 mode Date: Wed, 29 Nov 2023 17:55:43 +0000 Message-Id: <9b2fbc186e9610aa92bc0df428e36c7a70aad6a4.1701280438.git.aburgess@redhat.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org While reviewing another patch I spotted a timeout in gdb.ada/complete.exp when testing in READ1 mode, e.g.: $ make check-read1 TESTS="gdb.ada/complete.exp" ... FAIL: gdb.ada/complete.exp: complete break ada (timeout) ... The problem is an attempt to match the entire output from GDB within a single gdb_test_multiple pattern, for a completion command that returns a large number of completions. This commit changes the gdb_test_multiple to process the output line by line. I don't use the gdb_test_multiple -lbl option, as I've always found that option backward -- it checks for the \r\n at the start of each line rather than the end, I think it's much clearer to use '^' at the start of each pattern, and '\r\n' at the end, so that's what I've done here. .... Or I would, if this test didn't already define $eol as the end of line regexp ... except that $eol was set to '[\r\n]*', which isn't that helpful, so I've updated $eol to be just '\r\n' the actual end of line regexp. And now, the test passes without a timeout when using READ1. There should be no change in what is tested after this commit. --- gdb/testsuite/gdb.ada/complete.exp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/gdb/testsuite/gdb.ada/complete.exp b/gdb/testsuite/gdb.ada/complete.exp index 9e9250545e9..a73a012d1cc 100644 --- a/gdb/testsuite/gdb.ada/complete.exp +++ b/gdb/testsuite/gdb.ada/complete.exp @@ -28,7 +28,7 @@ clean_restart ${testfile} set bp_location [gdb_get_line_number "START" ${testdir}/foo.adb] runto "foo.adb:$bp_location" -set eol "\[\r\n\]*" +set eol "\r\n" # A convenience function that verifies that the "complete EXPR" command # returns the EXPECTED_OUTPUT. @@ -227,11 +227,20 @@ test_gdb_complete "ambiguous_func" \ 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 +gdb_test_multiple $test "" { + -re "^($test$eol)" { + exp_continue } + + -re "^(break ada\[\]\[a-z0-9._@/-\]*$eol)" { + exp_continue + } + + -re "^$gdb_prompt $" { + pass $gdb_test_name + } + -re "\[A-Z\].*$gdb_prompt $" { - fail "$test (gdb/22670)" + fail "$gdb_test_name (gdb/22670)" } }