From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Ni+YBhdPQGMnZgcAWB0awg (envelope-from ) for ; Fri, 07 Oct 2022 12:08:55 -0400 Received: by simark.ca (Postfix, from userid 112) id 0C1291E112; Fri, 7 Oct 2022 12:08:55 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=hDWuY23f; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id AE4421E0D3 for ; Fri, 7 Oct 2022 12:08:54 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3E5153898380 for ; Fri, 7 Oct 2022 16:08:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3E5153898380 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665158933; bh=B4HV+vD9aeoSqxtoIBi1cEO2UO1VM4VluGnNH6rkOik=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=hDWuY23fl5uJLwdNV6qNFs2f/WPX5SqiBP5kAXiQAPFNTTsbKZJhOCEfCPIOl739U 6xCPZWB6rJEnePNU5pSqMAeXjUYtJRvlZiZH/rrx3vmcuvkKQvwdtpdeZiNk7CpHLB iuYGmDsrkBAptzWuIWMxFmmeRMmH1O4n0FNqHdY4= Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id CC5313858CDB for ; Fri, 7 Oct 2022 16:08:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CC5313858CDB Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 03A6621958 for ; Fri, 7 Oct 2022 16:08:33 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id E3EED13A3D for ; Fri, 7 Oct 2022 16:08:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id is+UNgBPQGNHPQAAMHmgww (envelope-from ) for ; Fri, 07 Oct 2022 16:08:32 +0000 Date: Fri, 7 Oct 2022 18:08:31 +0200 To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Handle host cleanfiles Message-ID: <20221007160829.GA6905@delia.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi, When running test-case gdb.server/abspath.exp with host board local-remote-host-notty, I get: ... $ git sti ... deleted: gdb/testsuite/gdb.xml/trivial.xml ... This happens as follows. The test-case calls skip_gdbserver_test, which calls gdb_skip_xml_test, which does: ... set xml_file [gdb_remote_download host "${srcdir}/gdb.xml/trivial.xml"] ... Then proc gdb_remote_download appends $xml_file (which for this particular host board happens to be ${srcdir}/gdb.xml/trivial.xml) to cleanfiles, which ends up being handled in gdb_finish by: ... eval remote_file target delete $cleanfiles ... The problem is that a host file is deleted using target delete. Fix this by splitting cleanfiles up in cleanfiles_target and cleanfiles_host. Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Handle host cleanfiles --- gdb/testsuite/lib/gdb.exp | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 99a6de6f724..44cc28b3005 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -5572,10 +5572,14 @@ proc gdb_remote_download {dest fromfile {tofile {}}} { if {[is_remote $dest]} { # When the DEST is remote, we simply send the file to DEST. - global cleanfiles + global cleanfiles_target cleanfiles_host set destname [remote_download $dest $fromfile $tofile] - lappend cleanfiles $destname + if { $dest == "target" } { + lappend cleanfiles_target $destname + } elseif { $dest == "host" } { + lappend cleanfiles_host $destname + } return $destname } else { @@ -5722,7 +5726,8 @@ proc default_gdb_init { test_file_name } { global gdb_wrapper_initialized global gdb_wrapper_target global gdb_test_file_name - global cleanfiles + global cleanfiles_target + global cleanfiles_host global pf_prefix # Reset the timeout value to the default. This way, any testcase @@ -5838,7 +5843,8 @@ proc default_gdb_init { test_file_name } { global gdb_instances set gdb_instances 0 - set cleanfiles {} + set cleanfiles_target {} + set cleanfiles_host {} set gdb_test_file_name [file rootname [file tail $test_file_name]] @@ -6150,7 +6156,8 @@ proc gdb_init { args } { proc gdb_finish { } { global gdbserver_reconnect_p global gdb_prompt - global cleanfiles + global cleanfiles_target + global cleanfiles_host global known_globals if { [info procs ::gdb_tcl_unknown] != "" } { @@ -6162,9 +6169,13 @@ proc gdb_finish { } { # Exit first, so that the files are no longer in use. gdb_exit - if { [llength $cleanfiles] > 0 } { - eval remote_file target delete $cleanfiles - set cleanfiles {} + if { [llength $cleanfiles_target] > 0 } { + eval remote_file target delete $cleanfiles_target + set cleanfiles_target {} + } + if { [llength $cleanfiles_host] > 0 } { + eval remote_file host delete $cleanfiles_host + set cleanfiles_host {} } # Unblock write access to the banned variables. Dejagnu typically