From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id FPZZBhHuJmVKOisAWB0awg (envelope-from ) for ; Wed, 11 Oct 2023 14:48:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1697050129; bh=rF5Xah3dMYoo7dmX09k4gP2NkUpnstCl25CYhv99bWc=; h=Date:Subject:From:To:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=h9YIdxTYUS1HFMDh3s7QNjFz+cPqiMlKmDmAYZpZrdKqb5zFSfCultZfODyLcER8J 2JAY5sAiCZn0dPvD8bXC6Ao7P9pV9bRUrMGIomFz1Py7kJWmL4d7WrGqikVzq5wRML msTnu5dqwEHISwGqGOT+nDNDqZmJS5TAfqUp1c5g= Received: by simark.ca (Postfix, from userid 112) id 0935B1E0C1; Wed, 11 Oct 2023 14:48:49 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=twvi/TQ/; dkim-atps=neutral Received: from server2.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 ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id EE6E91E091 for ; Wed, 11 Oct 2023 14:48:46 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 870A13857803 for ; Wed, 11 Oct 2023 18:48:46 +0000 (GMT) Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id C53673858D1E for ; Wed, 11 Oct 2023 18:48:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C53673858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1697050114; bh=rF5Xah3dMYoo7dmX09k4gP2NkUpnstCl25CYhv99bWc=; h=Date:Subject:From:To:References:In-Reply-To:From; b=twvi/TQ/TOWG0OOlAjwiylrDV2XgfPZo15mu0KbMwkRIuxHDOkQhDr6zi5KXFaNnA 6mMzmWV4WWiW4Cr3CyUY+WLoiI3p52FuWTBmz+L77M31Sw9F4Lj5y/Pm+vALMx8aTe thtsJ5OgNTf2Q9h5psLgKYmymt+iX8+vKhH7IW7E= Received: from [172.16.0.192] (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 3ACA21E091; Wed, 11 Oct 2023 14:48:34 -0400 (EDT) Message-ID: <215fcfeb-3e93-4eec-baa0-0a2b0b326ce5@simark.ca> Date: Wed, 11 Oct 2023 14:48:33 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Fix test suite failure in file-then-restart.exp Content-Language: fr From: Simon Marchi To: Tom Tromey , gdb-patches@sourceware.org References: <20231011162142.2725265-1-tromey@adacore.com> <69137e71-b2d6-4505-a563-599c6eeead91@simark.ca> In-Reply-To: <69137e71-b2d6-4505-a563-599c6eeead91@simark.ca> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_PASS, 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+public-inbox=simark.ca@sourceware.org On 10/11/23 14:19, Simon Marchi wrote: > On 10/11/23 12:21, Tom Tromey wrote: >> Simon pointed out that the new file-then-restart.exp test fails with >> the extended-remote target board. >> >> The problem is that the test suite doesn't use gdb_file_cmd -- which >> handles things like "set remote exec-file". This patch changes >> gdb_file_cmd to make the "kill" command optional, and then switches >> the test case to use it. >> >> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30933 > > Thanks, I will give the patch a try. > >> diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp >> index 0a908e0af0f..63885860795 100644 >> --- a/gdb/testsuite/lib/gdb.exp >> +++ b/gdb/testsuite/lib/gdb.exp >> @@ -2146,6 +2146,9 @@ proc default_gdb_exit {} { >> # Load a file into the debugger. >> # The return value is 0 for success, -1 for failure. >> # >> +# ARG is the file name. >> +# KILL_FLAG, if given, indicates whether a "kill" command should be used. >> +# >> # This procedure also set the global variable GDB_FILE_CMD_DEBUG_INFO >> # to one of these values: >> # >> @@ -2165,7 +2168,7 @@ proc default_gdb_exit {} { >> # TODO: gdb.base/sepdebug.exp and gdb.stabs/weird.exp might be able to use >> # this if they can get more information set. >> >> -proc gdb_file_cmd { arg } { >> +proc gdb_file_cmd { arg {kill_flag 1} } { >> global gdb_prompt >> global GDB >> global last_loaded_file >> @@ -2194,15 +2197,17 @@ proc gdb_file_cmd { arg } { >> # The file command used to kill the remote target. For the benefit >> # of the testsuite, preserve this behavior. Mark as optional so it doesn't >> # get written to the stdin log. > > Wow, I didn't know about (or forgot) this behavior of gdb_file_cmd. > This seems like a relic of the past. I wonder how important that kill > is, if we can get rid of it. I would expect gdb_file_cmd to more or > less just issue the "file" command. I confirm that your patch fixes the fail I see on my CI. If we want to get rid of the kill behavior in gdb_file_cmd, your patch is a good step towards that, as it adds a knob for it. So it LGTM: Approved-By: Simon Marchi Simon