From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id WNIaAfInuWBoIwAAWB0awg (envelope-from ) for ; Thu, 03 Jun 2021 15:05:22 -0400 Received: by simark.ca (Postfix, from userid 112) id F3D731F163; Thu, 3 Jun 2021 15:05:21 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.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 407DD1E01F for ; Thu, 3 Jun 2021 15:05:21 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D0E93383F42C for ; Thu, 3 Jun 2021 19:05:20 +0000 (GMT) Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by sourceware.org (Postfix) with ESMTPS id 93A1D386FC39 for ; Thu, 3 Jun 2021 19:02:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 93A1D386FC39 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-wm1-f44.google.com with SMTP id r13so4039790wmq.1 for ; Thu, 03 Jun 2021 12:02:56 -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=Fu36on1ZK07wPl6ylQuDkGkqWZEIiMfIUqAphZxJgtajAaWvHC4Kq858DAaltZ5OTv diwbF9u+x+ezH6wW2pDhWoyIXVbVb3XjJ4LB4ZzmvepkYwbLoai3cIpCUfccyCyGbD/T bIFSzVIYoryP27SS1YpA+fuyJcxXHfuT+ua87FOrrREUZgpq31VN9e5vX/zwp4wSamit uBDjbJvPVg7nuKIS+3jIM019GtY3DCJkwaWEW00K6KGjDfg8azLZSMEWdJNb3Sp1oAsJ +hIpWEdf+yQxt8LP57NSh/+Vt4un5wIEp0hjpZTS/pNhML1cDtn8ZK+ObOPvfbv0hAdJ 0oaA== X-Gm-Message-State: AOAM530p+FIHleC92CmXWATkml2Lv83P9Xfp0QMAPfGmQ1CCMaXVc9pI dU+MUTrtj4Ciz3LBVuQwXvAoJnvvKhL7WQ== X-Google-Smtp-Source: ABdhPJyq11O6y6LZ31r7ykaHMR8IOmsGlIs5rCxNgYDXUVqRv/DF+EgHbhZ+/7KZQLpNCWQVR0gS/A== X-Received: by 2002:a7b:c38f:: with SMTP id s15mr11359wmj.16.1622746974949; Thu, 03 Jun 2021 12:02:54 -0700 (PDT) Received: from localhost ([2001:8a0:f932:6a00:6b6e:c7b6:c5a7:aac3]) by smtp.gmail.com with ESMTPSA id o9sm2393083wri.68.2021.06.03.12.02.53 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Jun 2021 12:02:53 -0700 (PDT) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 04/17] Make gdb.base/long-inferior-output.exp fail fast Date: Thu, 3 Jun 2021 20:02:30 +0100 Message-Id: <20210603190243.2609886-5-pedro@palves.net> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210603190243.2609886-1-pedro@palves.net> References: <20210603190243.2609886-1-pedro@palves.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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" 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