From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 06WjIF5McGoyvgEAWB0awg (envelope-from ) for ; Mon, 03 Aug 2026 04:07:58 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=U+MkA59C; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=1nmT2sUU; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=0Iep0qbN; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=sycvjmmu; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 75D6A1E09E; Mon, 03 Aug 2026 04:07:58 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, 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 [IPv6:2620:52:6:3111::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 38BEC1E033 for ; Mon, 03 Aug 2026 04:07:57 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 287FC4BB1C3E for ; Mon, 3 Aug 2026 08:07:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 287FC4BB1C3E Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=U+MkA59C; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=1nmT2sUU; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=0Iep0qbN; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=sycvjmmu Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by sourceware.org (Postfix) with ESMTPS id 14DF24BA79BB for ; Mon, 3 Aug 2026 08:07:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 14DF24BA79BB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 14DF24BA79BB Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:2 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785744451; cv=none; b=u8yvAU/Ar9G4FizivfjcR33CSezuXYGigCSJ9lrjx/niptjcEextignbWmnhhVsx0s0fYF7GHAtl/CdVmzirrcaVdQ9Iv0yjI1yw+JdGatW9fuLJMPL+EhYYPI6NsChDKoq+SZ9SegQRuZOQvACAgzhpjjjMnpQxvZdpNSJOodc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785744451; c=relaxed/simple; bh=lSG4LsjMR47TW9DTClwqlpikamY+JLYrQ1RqEe1U1rw=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-ID:MIME-Version; b=hKSp6BrvRL30kGcUAzlMMyFw7RChh8fDLrfPagogmcmt9M21UGL4osXTe/OQdhRAS0FFTXME8XIG9TyUHHrrD1DJSWDc9Lt5/Qh8fhbww/f6i70zQk0nZaRB7ErsPfBiTd3HfdOv0eNm5nyIQrQANbknmu+tzPIxez2MhxG9mC4= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=U+MkA59C; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=1nmT2sUU; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=0Iep0qbN; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=sycvjmmu DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 14DF24BA79BB Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id CBF664809 for ; Mon, 3 Aug 2026 08:07:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1785744446; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=TtuEj9zYS0KYDaLx0rsQnaY+k8MUd7n4v8OgVgZc1dA=; b=U+MkA59CgyFmtXCHQ8vwVoLt6i6wpAfIC1q7VH1v+WEiTWfDMIItJzL8WHO8aTuF7g7Rwc /r8WCS/F05ELew/LSNsZhd0oCXmO9cy74hIRvusC/YKFTMublpDRE7ylzJXPcQc7i+pnLp 34fORm0MbAi32BebGhy9xhvyISBuEwc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1785744446; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=TtuEj9zYS0KYDaLx0rsQnaY+k8MUd7n4v8OgVgZc1dA=; b=1nmT2sUUE68JNpHdMrP5f9vosOO0lr4/PmaxbG2FtF3DPe2g++iWSFdJRTRB0Kv0xN3Ta0 5PjcHOpugy1DstDA== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1785744441; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=TtuEj9zYS0KYDaLx0rsQnaY+k8MUd7n4v8OgVgZc1dA=; b=0Iep0qbNFruhQZHxUAWI5yzb2G9OEjCnu94wrQu1B13Itvd94KfYbJtGoTqWKSyKZ3sc0w 5DsDhozE+eo+R1TRNH+Rr2drbVf8njf4k4tinn1t+SKBHrlKYYdejdBgoiQyz2pEyVHUPQ 7hmURZM47vQV/Xj4VTcpUdkSMYLaSQg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1785744441; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=TtuEj9zYS0KYDaLx0rsQnaY+k8MUd7n4v8OgVgZc1dA=; b=sycvjmmut19CWUMEPbLK1k+m30sQaC7l6lDP12qQ9aSMAAxTZ67cqUFNSHkQjVZSsEEote siBFD1p50lNE4ACg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id B6D5E779D3 for ; Mon, 3 Aug 2026 08:07:21 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id OKtCKzlMcGp4SgAAD6G6ig (envelope-from ) for ; Mon, 03 Aug 2026 08:07:21 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH] [gdb/testsuite] Fix gdb.python/py-selected-context.exp regexp Date: Mon, 3 Aug 2026 10:07:21 +0200 Message-ID: <20260803080721.859964-1-tdevries@suse.de> X-Mailer: git-send-email 2.51.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Result: default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; URIBL_BLOCKED(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; RCVD_TLS_ALL(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; FROM_EQ_ENVFROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid] 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 On ppc64-linux, with test-case gdb.python/py-selected-context.exp I run into: ... (gdb) info inferiors^M Num Description Connection Executable ^M 1 ^M * 2 ^M (gdb) FAIL: $exp: check inferior 2 was selected ... In contrast, on x86_64-linux, I get: ... (gdb) info inferiors^M Num Description Connection Executable ^M 1 ^M * 2 ^M (gdb) PASS: $exp: check inferior 2 was selected ... The output is identical, so it's surprising that there's a different outcome. The proc doing the check is: ... proc check_inferior { inf testname } { gdb_test "info inferiors" \ "\r\n\\*\\s+[string_to_regexp $inf]\\s+\[^\r\n\]*(?=\r\n)" \ $testname } ... The problem seems to be triggered by the lookahead part '(?=\r\n)': removing it makes the test pass. By switching on some debugging in gdb_test_multiple, we get this info: ... Looking to match ""(?:\r\n\*\s+2\s+[^\r\n]*(?=\r\n))\r\n\(gdb\) $"" ... which shows that the lookahead '(?=\r\n)' is immediately followed by a '\r\n', making the lookahead superfluous. Still, the test should not fail. This may be an expect bug, or a miscompilation of expect. I've filed a testsuite PR [1] about it for further investigation. But, there's another problem with the regexp. If we use the same proc to try to match inferior 1, we get a FAIL on both setups: ... (gdb) info inferiors^M Num Description Connection Executable ^M * 1 ^M 2 ^M (gdb) FAIL: $exp: check inferior 1 was selected ... The problem is that the regexp doesn't allow a line after the matching line. Fix this this by appending '.*' to the regexp. Doing so also has the effect that we no longer run into the expect problem. While we're at it, rewrite the regexp to a more modern form, and drop the unnecessary string_to_regexp: ... [multi_line \ "" \ [subst_vars {[*]\s+$inf\s+[^\r\n]*(?=\r\n).*}]] ... Tested on x86_64-linux and ppc64-linux. [1] https://sourceware.org/pipermail/gdb-prs/2026q3/047709.html --- gdb/testsuite/gdb.python/py-selected-context.exp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.python/py-selected-context.exp b/gdb/testsuite/gdb.python/py-selected-context.exp index 28b9b456003..07ace151f26 100644 --- a/gdb/testsuite/gdb.python/py-selected-context.exp +++ b/gdb/testsuite/gdb.python/py-selected-context.exp @@ -46,7 +46,9 @@ proc event_regexp { inferior {thread "None"} {frame "None"}} { # inferior. INF should be an inferior number, e.g. '1', '2', etc. proc check_inferior { inf testname } { gdb_test "info inferiors" \ - "\r\n\\*\\s+[string_to_regexp $inf]\\s+\[^\r\n\]*(?=\r\n)" \ + [multi_line \ + "" \ + [subst_vars {[*]\s+$inf\s+[^\r\n]*(?=\r\n).*}]] \ $testname } base-commit: dde72c6764ecdd5a6af7295c1087c87bbaa7cfec -- 2.51.0