From patchwork Fri May 17 09:53:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 90362 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 6CDF1384AB54 for ; Fri, 17 May 2024 09:53:05 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id 283DE3858D20 for ; Fri, 17 May 2024 09:52:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 283DE3858D20 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 283DE3858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715939563; cv=none; b=cM1SfLow+tQxaOzCo1fWIy656zRbm0Wv4t8dSqn9L1PNL63OgfEZPhpq9fzkRB2F4Dq7WoUHK1bp5G+Jj1ykwr7KhqM/B1WGYfRpi8prljNpAK61fi7bkOD7uf/q6wR3yI9DkEZzkS97GMyKRPLSPTh4cm4kV/FqCrXGRgvxfTI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715939563; c=relaxed/simple; bh=NWWURUqHLY88GqMKq4uGfE4Iw91wiD/OpSrfOB5HD7M=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-Id:MIME-Version; b=ds/IyYJ2I5kcyBhVL54z62pp94yVxlrMmgeeYcKOGXKHU5zTjDfnWItYhjwQw0Rwg2Vtaa0AUHeDYOuQZE4F8haP/WC36mculLpwuuMnaAc0/+abLVoOUNeZJMHLVEwUPb3Qbdv2pUuXr7ZryOcT1i8PmCv0r+cfhqxX2DY1obY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104: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 1A8885D208 for ; Fri, 17 May 2024 09:52:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1715939560; 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=V4gqavbhuE3GmVAxErlATC51sg2AcH00bJtRxsAsVz4=; b=Yp5CYIRdS0lV9OaL1rPRmXaSRBB1kn3rjsMwi3W2wjAzhKXVqQWcH6rC9MrLDS1GR1NlQt anGQd8IY8E0mIG0Isb+/hNIHghjaSaPXJfxFeOaYptY3fSLYQR4y5n68NkAnekLtfSU0Et DQYNLNJl2VFJibtk4I1EKBQ/NvqcJlc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1715939560; 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=V4gqavbhuE3GmVAxErlATC51sg2AcH00bJtRxsAsVz4=; b=ZUPmeFQuJK1iKR9guA47Kn+HUNTLniLFzR5xIAwAEJSjdQWKK4daA5lzfLxXaWT1qgphdN 5FyN/GIbd2hxQ6Cw== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=Yp5CYIRd; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=ZUPmeFQu DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1715939560; 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=V4gqavbhuE3GmVAxErlATC51sg2AcH00bJtRxsAsVz4=; b=Yp5CYIRdS0lV9OaL1rPRmXaSRBB1kn3rjsMwi3W2wjAzhKXVqQWcH6rC9MrLDS1GR1NlQt anGQd8IY8E0mIG0Isb+/hNIHghjaSaPXJfxFeOaYptY3fSLYQR4y5n68NkAnekLtfSU0Et DQYNLNJl2VFJibtk4I1EKBQ/NvqcJlc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1715939560; 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=V4gqavbhuE3GmVAxErlATC51sg2AcH00bJtRxsAsVz4=; b=ZUPmeFQuJK1iKR9guA47Kn+HUNTLniLFzR5xIAwAEJSjdQWKK4daA5lzfLxXaWT1qgphdN 5FyN/GIbd2hxQ6Cw== 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 EB9F513942 for ; Fri, 17 May 2024 09:52:39 +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 cmTwN+coR2ZlMwAAD6G6ig (envelope-from ) for ; Fri, 17 May 2024 09:52:39 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH] [gdb/testsuite] Fix can_spawn_for_attach_1 consistency check Date: Fri, 17 May 2024 11:53:41 +0200 Message-Id: <20240517095341.6035-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-Spam-Score: -2.94 X-Rspamd-Action: no action X-Rspamd-Queue-Id: 1A8885D208 X-Spam-Level: X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-2.94 / 50.00]; BAYES_HAM(-2.93)[99.70%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_DN_NONE(0.00)[]; DWL_DNSWL_BLOCKED(0.00)[suse.de:dkim]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo, imap1.dmz-prg2.suse.org:rdns, suse.de:dkim] X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP 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 When running test-case gdb.testsuite/gdb-caching-proc-consistency.exp with target board native-gdbserver, we run into: ... (gdb) ERROR: tcl error sourcing gdb.testsuite/gdb-caching-proc-consistency.exp. ERROR: gdbserver does not support attach 4827 without extended-remote while executing "error "gdbserver does not support $command without extended-remote"" (procedure "gdb_test_multiple" line 51) invoked from within "gdb_test_multiple "attach $test_pid" "can spawn for attach" { -re -wrap "$attaching_re\r\n.*ptrace: Operation not permitted\\." { # Not permitte..." (procedure "gdb_real__can_spawn_for_attach_1" line 27) invoked from within "gdb_real__can_spawn_for_attach_1" ... The problem is that: - can_spawn_for_attach_1 is a helper function for can_spawn_for_attach, designed to be called only from that function, and - can_spawn_for_attach_1 is a gdb_caching_proc, and consequently test-case gdb.testsuite/gdb-caching-proc-consistency.exp calls can_spawn_for_attach_1 directly. Fix this by copying the early-outs from can_spawn_for_attach to can_spawn_for_attach_1. Tested on x86_64-linux. Reported-By: Simon Marchi --- gdb/testsuite/lib/gdb.exp | 7 +++++++ 1 file changed, 7 insertions(+) base-commit: 44fc9616c2e74396395f60c9a601317e4c4c4733 diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index aea0ba599c7..55f6ab1fd8b 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -6191,6 +6191,13 @@ proc gdb_exit { } { # return 0 only if we cannot attach because it's unsupported. gdb_caching_proc can_spawn_for_attach_1 {} { + # For the benefit of gdb-caching-proc-consistency.exp, which + # calls can_spawn_for_attach_1 directly. Keep in sync with + # can_spawn_for_attach. + if { [is_remote target] || [target_info exists use_gdb_stub] } { + return 0 + } + # Assume yes. set res 1