From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 65075 invoked by alias); 5 Apr 2016 17:47:23 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 65060 invoked by uid 89); 5 Apr 2016 17:47:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1975, transferred X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 05 Apr 2016 17:47:20 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4BAD5BE01E; Tue, 5 Apr 2016 17:47:19 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u35HlIi1019700; Tue, 5 Apr 2016 13:47:18 -0400 Subject: Re: [PATCH v2 1/2] Improve gdb_remote_download, remove gdb_download To: Simon Marchi , gdb-patches@sourceware.org References: <1459794657-2087-1-git-send-email-simon.marchi@ericsson.com> From: Pedro Alves Message-ID: <5703FA26.2080907@redhat.com> Date: Tue, 05 Apr 2016 17:47:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <1459794657-2087-1-git-send-email-simon.marchi@ericsson.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-04/txt/msg00093.txt.bz2 On 04/04/2016 07:30 PM, Simon Marchi wrote: > > -# Like remote_download but provides a gdb-specific behavior. If DEST > -# is "host", and the host is not remote, and TOFILE is not specified, > -# then the [file tail] of FROMFILE is passed through > -# standard_output_file to compute the destination. > +# Like remote_download but provides a gdb-specific behavior. > +# > +# If the destination board is remote, the local file FROMFILE is transferred as > +# usual with remote_download to TOFILE on the reemote board. The destination Typo "reemote". > +# filename is added to the CLEANFILES global, so it can be cleaned up at the > +# end of the test. > +# > +# If the destination board is local, the destination path TOFILE is passed > +# through standard_output_file, and FROMFILE is copied there. > +# > +# In both cases, if TOFILE is omitted, it defaults to the [file tail] of > +# FROMFILE. > > proc gdb_remote_download {dest fromfile {tofile {}}} { > - if {$dest == "host" && ![is_remote host] && $tofile == ""} { > - set tofile [standard_output_file [file tail $fromfile]] > + # If TOFILE is not given, default to the same filename as FROMFILE. > + if {[string length $tofile] == 0} { > + set tofile [file tail $fromfile] > } > > - if { $tofile == "" } { > - return [remote_download $dest $fromfile] > - } else { > - return [remote_download $dest $fromfile $tofile] > - } > -} > + if {[is_remote $dest]} { > + # When the DEST is remote, we simply send the file to the target. > + global cleanfiles Shouldn't this be, "When the DEST is remote, we simply send the file to DEST" ?. > > -# gdb_download > -# > -# Copy a file to the remote target and return its target filename. > -# Schedule the file to be deleted at the end of this test. > + set destname [remote_download target $fromfile $tofile] and thus here be "remote_download $dest" ? > + lappend cleanfiles $destname Thanks, Pedro Alves