From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by sourceware.org (Postfix) with ESMTPS id 853D6397300D for ; Mon, 14 Jun 2021 21:24:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 853D6397300D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f41.google.com with SMTP id l2so16014824wrw.6 for ; Mon, 14 Jun 2021 14:24:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4UhvP6rlEG+TOufz2G+MOvaudZ6Sgma2GTYRoiHCVmI=; b=IfWlol0Lyee+sQryEytaNdeO08zyLLWem4/mMgEVz21Dnw0pojdOspFpd6gqSpiG8D jS4BHbZymNPLOE7t3H3ei814ClL5fN+mVM75c+Dhe1YVj1Z1WJOZupyrRwapzvPTI7ep HSQS3LR3wn2gRyJX8fj/0FYdWqLLErfDpOq3gQQ8Ayx77iwY8L+KNOgSuIgOnArGgm6M b9lnG2I46mPOEBtAzXtcXXltUuGnLtogBizJFTYvHGxfxP0JJNBTGKcACrd334Gt3gKq 4Qgf9g+mgLBdLNL/GV1bMJj7Tpc+xpvijsoCcKY4Se+fKu2E3wbShcMEwhDcLTmvfD2+ JhgQ== X-Gm-Message-State: AOAM53163U69AYSCYLuAjw9rzsq5e0AT6pGaG3CPqwzwaC0klNIiC5We pT6Er7RWDzj+/gbEOkSg3lCvekeHUv6a3g== X-Google-Smtp-Source: ABdhPJzFvXzCXA4BPpq6Z+YfgVL0Q0Saa4MbE+mI5mtLKkCbix0gF//+JSdMzZo7l793acH2q34Cmg== X-Received: by 2002:a5d:64c7:: with SMTP id f7mr20862699wri.36.1623705858117; Mon, 14 Jun 2021 14:24:18 -0700 (PDT) Received: from localhost ([2001:8a0:f932:6a00:6b6e:c7b6:c5a7:aac3]) by smtp.gmail.com with ESMTPSA id e27sm18369031wra.50.2021.06.14.14.24.16 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Jun 2021 14:24:17 -0700 (PDT) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH v2 03/16] Make gdb.base/long-inferior-output.exp fail fast Date: Mon, 14 Jun 2021 22:23:57 +0100 Message-Id: <20210614212410.1612666-4-pedro@palves.net> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210614212410.1612666-1-pedro@palves.net> References: <20210614212410.1612666-1-pedro@palves.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: , X-List-Received-Date: Mon, 14 Jun 2021 21:24:20 -0000 A local change I was working on had a bug that made GDB lose inferior output, which was caught by the gdb.base/long-inferior-output.exp testcase. While debugging the problem, I found it useful to have the testcase fail quickly when it noticed output was missing. Also, tighten the regexes to make sure that we don't get spurious/repeated/bogus output between each "this is line number ..." line. gdb/testsuite/ChangeLog: yyyy-mm-dd Pedro Alves * gdb.base/long-inferior-output.exp: Don't set "more" when we see an unexpected "this is line number" number. Change-Id: I53e8499bd8fdbf961431a7f2a94d263da6a9f573 --- .../gdb.base/long-inferior-output.exp | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/gdb.base/long-inferior-output.exp b/gdb/testsuite/gdb.base/long-inferior-output.exp index 294786ffff2..c0e18029600 100644 --- a/gdb/testsuite/gdb.base/long-inferior-output.exp +++ b/gdb/testsuite/gdb.base/long-inferior-output.exp @@ -47,21 +47,46 @@ if { ![runto_main] } then { set printing_done_line [gdb_get_line_number "printing done"] gdb_test "break $printing_done_line" ".*" "set breakpoint after printing" -send_gdb "continue\n" +gdb_test_multiple "continue" "" { + -re "Continuing\.\r\n" { + pass $gdb_test_name + } +} set expected_lines 3000 set more 1 set i 0 while {$more} { set more 0 + + # Make sure that we don't get spurious/repeated/bogus output + # between each "this is line number ..." line, with an anchor. + # But consume any output that precedes the first line, because + # when testing against GDBserver, we'll get: + # + # continue + # Continuing. + # PASS: gdb.base/long-inferior-output.exp: continue + # Remote debugging from host ::1, port 40044 + # this is line number 0 + # ... + if {$i != 0} { + set anchor "^" + } else { + set anchor "" + } + gdb_expect { -i $inferior_spawn_id - -ex "this is line number $i" { + -re "${anchor}this is line number $i\r\n" { incr i - if {$i != $expected_lines} { + if {$i != $expected_lines} { set more 1 } } + -re "this is line number \[^\r\n\]*\r\n" { + # If we see this, we've lost output. + } } } -- 2.26.2