From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Ds7WE7CA+2rZ1hQAWB0awg (envelope-from ) for ; Mon, 16 Nov 2026 17:16:16 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=PerfWcwX; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 3C8F31E091; Mon, 16 Nov 2026 17:16:16 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 4948E1E023 for ; Mon, 16 Nov 2026 17:16:14 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id ABD554B1A355 for ; Mon, 16 Nov 2026 22:16:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ABD554B1A355 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=PerfWcwX Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id E47494BA2E09 for ; Mon, 16 Nov 2026 22:15:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E47494BA2E09 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine 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 E47494BA2E09 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794867347; cv=none; b=uHtqjbO1xQDWLxKXNSWjBOasjDh/zjIcKnVG9qBpPlvADBqieKGQbmhoLR5mT0mdboM9UdxXaDswbJW3X8DNe7ZYicfUSYlwkFQsGBnXkEZkzpbfCvXaYpvkyO/uJdABLpX4RLbqfUvXXRBdq7w99Oo4G+7QPo80O/dnrKs8EAA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794867347; c=relaxed/simple; bh=O26EATm+nvoM1R3hi+whIh8ruHtD1DiV4bXiY5860m8=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=t/CJcU9p3THB1PDIrPQjR/FeqZKj5ylp9+RP20Gc5xMxUmuTbsIJpHZ/hiB6UJ5Db8zSyNw+oiXnsWA8uMYtwSDaTGfiSDd0sPa/WxcYUhtYBS06XadzcuU6Dhk/pPgICfceuTQf8Hg4AGuMAKOs6EmOODdKVFIG5AS1v73I5sA= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=PerfWcwX DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E47494BA2E09 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1794867346; 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; bh=wDU8xUpqwGEXZ6apYb+HMg8Gp01D56rk/jbpiKfzCj0=; b=PerfWcwXxGFSJE7V+OQP6uXnljrCCGBItKt2Y+1XaGKAJgU2tOoB/8nbIKIiyTiLJy1K7U ayhD3a9PMd5XI1wcxbG6In/8umVcseZIdDey3W7bkfx9a0xuaw7SDeMXv2Tufap7JiVI3b yVZqllAHUPcNkKNFmBv+2rvMXfiW5O4= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-616-y0fKS1kEOby0dQC6-MPu1Q-1; Mon, 16 Nov 2026 17:15:44 -0500 X-MC-Unique: y0fKS1kEOby0dQC6-MPu1Q-1 X-Mimecast-MFC-AGG-ID: y0fKS1kEOby0dQC6-MPu1Q_1794867343 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-499ca65ae87so137142f8f.1 for ; Mon, 16 Nov 2026 14:15:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794867343; x=1795472143; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=wDU8xUpqwGEXZ6apYb+HMg8Gp01D56rk/jbpiKfzCj0=; b=zdsv6Jeaqm/mgqoykH+2WqVZsHm553lyXHAJW38iuKiKQHF5aLEDv3cGbyomCWkJJo ooScQBFxc1p8FP2Ia7P57J1R4GlCq8nyn9jNdgcY4NrAst9GxEpc362wq6rHBr4+wJFa C1aFmQUIEzh/qZ+6osp/7USv79Pkz7z5vyMZ+ap0JLfLR38JFpa44TFF9SVgmol7HHa0 y1kBB5QAQuq6/isFLYvP2qe7mHtJa8bg/rgu5DYrHcxywyea6T0dL+vvuCsAb3iPcsFf kNVLfKPpM2D7Pn3Gx/kb2Gnll+oYBfBm+NSei+8Y3YMKyGMrZrZ387Rniy6XAXfMmMtl lojw== X-Gm-Message-State: APuU4Z+GW/qFZD/UiP6fB5cMoRiS4ZkNdjI4JlCVrVFXDEVwXGIY5PGr q+k6YV7ZxZ0gTHHA2u7UTbIK3gvWdzUqWN+fBRFswYsnTRJZvgLVerb2yNp+St/Zdq2P6QgCgLe d3bFaSEmJ1nFi4OTmTCWTblkczqjUrIzaeWZ0KbbiomkLLr2m1ZEPwD0H0Mxr9DDXfCyAPvKmno SXRad44uFqejrBrweN9zzZJp+psepu4UBCjQvaxS9oPVZyGV4= X-Gm-Gg: AZFdTZdwkHL7Cqcr4rFJdm+Pa8Gx9GAtEcRIit6QfmMCSevzxybO9DJmZdRaoRsuM8K Sdu81ExGBQUuMZMeaFTUT00aObllVl50qM8EnrBd/Lr77nmvKmeD7IR1wgdRS3qTeVBpYWsRCgk yOaOCyU5HAMu/jzHlkQBsMDkSLuFHIHPClRS3vOSo8IdD1n44aBna5qQhOShfWBD3MXEeexgwAh anQsoxBWus+u2QP7LMhckhPzpkSS1z3HrR3f6gY7mbLldTl94ziQ7HS+9DRCQ3fw1ObbXpfG9S5 DbSGqmMPFsKyaEmAhIC6veUsjCYdlTsSisO+sQVwFcna/hN2+gKVEeXT7xk2HxaJMypTY4roMah c6EE7CFUkq8dQztkYqFIajlLlgdDdXwA5oCDBnDHzyAfnNg== X-Received: by 2002:a05:6000:4013:b0:498:6171:c074 with SMTP id ffacd0b85a97d-4a36c30c9e0mr1900799f8f.3.1794867343147; Mon, 16 Nov 2026 14:15:43 -0800 (PST) X-Received: by 2002:a05:6000:4013:b0:498:6171:c074 with SMTP id ffacd0b85a97d-4a36c30c9e0mr1900742f8f.3.1794867342571; Mon, 16 Nov 2026 14:15:42 -0800 (PST) Received: from localhost ([83.216.138.189]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4a2e6c765dfsm3036421f8f.33.2026.11.16.14.15.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Nov 2026 14:15:41 -0800 (PST) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH] gdb/testsuite: fix intermittent failure in gdb.trace/mi-tsv-changed.exp Date: Mon, 16 Nov 2026 22:15:37 +0000 Message-Id: <44281f8bb47c5c1245c1667977912888b160394a.1794867326.git.aburgess@redhat.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: A_qU1q0VE8BM-JiB7G-hl1dLCRNvlWPpO2eeOf_sRDI_1794867343 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true 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~public-inbox=simark.ca@sourceware.org When running with the native-gdbserver board I would sometimes see failures in the test gdb.trace/mi-tsv-changed.exp. Below is a trimmed down extract from gdb.log which shows some of the most interesting lines. I had to trim this down as it's an MI test, so there's a lot of output: -exec-continue ^running *running,thread-id="all" (gdb) -trace-stop *stopped,reason="breakpoint-hit",... (gdb) PASS: gdb.trace/mi-tsv-changed.exp: create delete modify: trace stop -trace-list-variables ^done,stop-reason="request",frames="1",... (gdb) PASS: gdb.trace/mi-tsv-changed.exp: create delete modify: list trace variables tvariable $tvar3 = 2 ^done,trace-variables={nr_rows="2",nr_cols="3",hdr=... (gdb) FAIL: gdb.trace/mi-tsv-changed.exp: create delete modify: tvariable $tvar3 modified to 2 (unexpected output) &"tvariable $tvar3 = 2\n" It's maybe hard to see, but the output gets out of sync, the line: PASS: gdb.trace/mi-tsv-changed.exp: create delete modify: trace stop indicating that the trace-stop worked is reported after the output: *stopped,reason="breakpoint-hit",... which is the inferior hitting a breakpoint as a result of the -exec-continue. It's not the output corresponding to the -trace-stop. That output comes later: ^done,stop-reason="request",frames="1",... which is associated with this PASS line: PASS: gdb.trace/mi-tsv-changed.exp: create delete modify: list trace variables What's going wrong here is that the test send -exec-continue, but never waits for the inferior to stop. GDB then sends the -trace-stop but the pattern for that is just {.*}. This means that if the -trace-stop sees the prompt after the breakpoint hit, but not the prompt after the -trace-stop command, then the tests can get out of sync. Eventuallt there's a test with a pattern more details than just {.*}, at which point we get a FAIL reported. It is easier to reproduce this failure when using the 'read1' target, like: make -C gdb check-read1 TESTS=gdb.trace/mi-tsv-changed.exp \ RUNTESTFLAGS="--target_board=native-gdbserver" Fix this by adding a mi_expect_stop call after sending the -exec-continue. This way we wait for the breakpoint to be hit before sending the -trace-stop. I've also changed two of the .* patterns to include at least the first part of the expected output, e.g: mi_gdb_test "-trace-stop" {.*} "trace stop" becomes: mi_gdb_test "-trace-stop" "\\^done,stop-reason=\"request\",.*" \ "trace stop" Now, if the output gets out of sync we see more failures which makes it easier to see where things got out of sync. With this change in place the test passes reliably for me now. --- gdb/testsuite/gdb.trace/mi-tsv-changed.exp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/gdb.trace/mi-tsv-changed.exp b/gdb/testsuite/gdb.trace/mi-tsv-changed.exp index ded552cb24b..835a5f0deea 100644 --- a/gdb/testsuite/gdb.trace/mi-tsv-changed.exp +++ b/gdb/testsuite/gdb.trace/mi-tsv-changed.exp @@ -117,13 +117,17 @@ proc test_create_delete_modify_tsv { } { "continue to begin breakpoint" mi_gdb_test "-trace-start" {.*\^done} "trace start" mi_send_resuming_command "exec-continue" "continuing to end" - mi_gdb_test "-trace-stop" {.*} "trace stop" + mi_expect_stop "breakpoint-hit" "end" ""\ + ".*" ".*" {"" "disp=\"keep\""} \ + "continue to end breakpoint" + mi_gdb_test "-trace-stop" "\\^done,stop-reason=\"request\",.*" \ + "trace stop" # Force GDB to get the current value of trace state variable. - mi_gdb_test "-trace-list-variables" ".*" "list trace variables" + mi_gdb_test "-trace-list-variables" "\\^done,trace-variables=.*" \ + "list trace variables" mi_gdb_test "tvariable \$tvar3 = 2" \ ".*=tsv-modified,name=\"tvar3\",initial=\"2\",current=\"6\".*\\^done" \ "tvariable \$tvar3 modified to 2" - } } base-commit: a729341631f5ddea915cebe722e4ec198ff96c38 -- 2.25.4