From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id gYlIJvsexmoXkQ0AWB0awg (envelope-from ) for ; Wed, 07 Oct 2026 06:29:15 -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=XLbBAcQ1; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=GZhb++6F; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=XLbBAcQ1; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=GZhb++6F; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 98A761E051; Wed, 07 Oct 2026 06:29:15 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.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,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED 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 B7FF41E04E for ; Wed, 07 Oct 2026 06:29:14 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DBC7F4BA2E0B for ; Wed, 7 Oct 2026 10:29:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DBC7F4BA2E0B 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=XLbBAcQ1; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=GZhb++6F; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=XLbBAcQ1; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=GZhb++6F 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 42A564BA5433 for ; Wed, 7 Oct 2026 10:28:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 42A564BA5433 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 42A564BA5433 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=1791368929; cv=none; b=x26ipQ9W8iXx0PS+ea9athpOcFWNXGA6ZfzN49EfgtEDTNlfap99crWIn2j7+VOREi9mhJGsCFrT26qaBdgmj02XOYKX3tYgGTsUrsue1G5tGLQXriG0YgMqM4pl8lMqBLWs++7Ae2kXdSJdCXj0e6eWs0W6yzUKkUDrXcZE4bA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1791368929; c=relaxed/simple; bh=gSeZEUg8OGnxOO8WngZ/mGiwo9Vla6qN8MCYVBt4Fgs=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature: Message-ID:Date:MIME-Version:Subject:From:To; b=TH4HqDgQbQl6nIN5pp04Cq4w1c5vaBNl0cXsBecvY4m9W3E/xdIiz7Xq42KJA6kBFfgJoEeoEQuIsuynVfy6AZ60JYSL/5ROzAikJRUrhElttaPz8E+AyRLaecz4909mye1RNSOP9dSvM7sDvuJ8i59T1b14dn2gQKNoW+M7NGw= 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=XLbBAcQ1; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=GZhb++6F; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=XLbBAcQ1; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=GZhb++6F DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 42A564BA5433 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 519841F852 for ; Wed, 7 Oct 2026 10:28:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1791368928; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=U6zbt2mPcUe+G+m9tDuTYevjvpVD3TzGqS7NPiWkpNE=; b=XLbBAcQ1tOr1LTWPNEdrmd4iu/rmjGyQuGj26buNtw9Ze40EnYTK5rtiYiD1UdUub3ddqR VnkGlL5ZJjTTDcBwd/MQXXG7ahu4rrzsKorF1MU3EgWc4is6YmnmWVlX7mXolIguc9jeB3 feD7rwKrxE6MXF9kaS1MQCqvt3Oz+E0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1791368928; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=U6zbt2mPcUe+G+m9tDuTYevjvpVD3TzGqS7NPiWkpNE=; b=GZhb++6FvBXmFig99CsZJItiuAAypADJ9sznnXRcJ7eYGwoPo0U38QjmzUb1kA25s5vbrK 3L9oolnLVXDR0DAA== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1791368928; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=U6zbt2mPcUe+G+m9tDuTYevjvpVD3TzGqS7NPiWkpNE=; b=XLbBAcQ1tOr1LTWPNEdrmd4iu/rmjGyQuGj26buNtw9Ze40EnYTK5rtiYiD1UdUub3ddqR VnkGlL5ZJjTTDcBwd/MQXXG7ahu4rrzsKorF1MU3EgWc4is6YmnmWVlX7mXolIguc9jeB3 feD7rwKrxE6MXF9kaS1MQCqvt3Oz+E0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1791368928; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=U6zbt2mPcUe+G+m9tDuTYevjvpVD3TzGqS7NPiWkpNE=; b=GZhb++6FvBXmFig99CsZJItiuAAypADJ9sznnXRcJ7eYGwoPo0U38QjmzUb1kA25s5vbrK 3L9oolnLVXDR0DAA== 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 2178013312 for ; Wed, 7 Oct 2026 10:28:47 +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 yzoMKN8exmqmRgAAD6G6ig (envelope-from ) for ; Wed, 07 Oct 2026 10:28:47 +0000 Message-ID: Date: Wed, 7 Oct 2026 12:28:47 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/3] [gdb/testsuite] Fix gdb.base/quit-live.exp for remote host From: Tom de Vries To: gdb-patches@sourceware.org References: <20260919084237.1045724-1-tdevries@suse.de> <20260919084237.1045724-4-tdevries@suse.de> Content-Language: en-US In-Reply-To: <20260919084237.1045724-4-tdevries@suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [-4.27 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-0.98)[-0.984]; NEURAL_HAM_SHORT(-0.19)[-0.971]; MIME_GOOD(-0.10)[text/plain]; XM_UA_NO_VERSION(0.01)[]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo] 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 9/19/26 10:42 AM, Tom de Vries wrote: > I ran into trouble running test-case gdb.base/quit-live.exp using a remote > host configuration: > - host board local-remote-host > - target board remote-gdbserver-on-localhost. > > The test-case uses kill to send a signal to gdb_spawn_id, but with remote host > the gdb_spawn_id points to an ssh session, not gdb. > > Detect this more clearly by factoring out a proc kill_gdb (and > remote_kill_spawn_id and remote_kill_spawn_id_p), and erroring out for remote > host/target. > > Then fix this by skipping the relevant tests using remote_kill_spawn_id_p. I've pushed this. Thanks, - Tom > --- > gdb/testsuite/gdb.base/quit-live.exp | 13 ++++++++++--- > gdb/testsuite/lib/gdb.exp | 29 ++++++++++++++++++++++++++++ > 2 files changed, 39 insertions(+), 3 deletions(-) > > diff --git a/gdb/testsuite/gdb.base/quit-live.exp b/gdb/testsuite/gdb.base/quit-live.exp > index 8dae4fe2aca..8e1b4a428c7 100644 > --- a/gdb/testsuite/gdb.base/quit-live.exp > +++ b/gdb/testsuite/gdb.base/quit-live.exp > @@ -43,8 +43,7 @@ if {[build_executable "failed to build" $testfile $srcfile debug]} { > # Send signal SIG to GDB, and expect GDB to exit. > > proc test_quit_with_sig {sig} { > - set gdb_pid [exp_pid -i [board_info host fileid]] > - remote_exec host "kill -$sig ${gdb_pid}" > + kill_gdb $sig > > set test "quit with SIG$sig" > # If GDB mishandles the signal and doesn't exit, this should FAIL > @@ -176,7 +175,15 @@ foreach_with_prefix appear_how {"run" "attach" "attach-nofile"} { > } > > foreach_with_prefix extra_inferior {0 1} { > - foreach_with_prefix quit_how {"quit" "sigterm" "sighup"} { > + set qhs {} > + lappend qhs "quit" > + foreach sig {"sigterm" "sighup"} { > + if {[remote_kill_spawn_id_p host $sig]} { > + lappend qhs $sig > + } > + } > + > + foreach_with_prefix quit_how $qhs { > quit_with_live_inferior $appear_how $extra_inferior $quit_how > } > } > diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp > index 7bdc5dad0a7..b249425528d 100644 > --- a/gdb/testsuite/lib/gdb.exp > +++ b/gdb/testsuite/lib/gdb.exp > @@ -12473,6 +12473,35 @@ proc unprintable_to_octal { input_string } { > # Ignore args and don't do anything. Can be used with proc with_override. > proc nop {args} {} > > +# Return 1 if SIG can be delivered to a spawn_id on board. > +proc remote_kill_spawn_id_p { board sig } { > + if {$board == "host" || $board == "target"} { > + if {[isremote $board]} { > + # For remote host/target, the spawn_id holds the pid of the ssh > + # session, so we'd end up sending signals to ssh instead. > + return 0 > + } > + } > + > + return 1 > +} > + > +# Send SIG to PID on BOARD. > +proc remote_kill_spawn_id { board spawn_id sig } { > + set pid [exp_pid -i $spawn_id] > + > + if {![remote_kill_spawn_id_p $board $sig]} { > + error "Can't send signal $sig to $pid on remote $board" > + } > + > + return [remote_exec $board "kill -$sig $pid"] > +} > + > +# Send SIG to GDB. > +proc kill_gdb { sig } { > + return [remote_kill_spawn_id host $::gdb_spawn_id $sig] > +} > + > require {tcl_version_at_least 8 6 2} > > # Always load compatibility stuff.