From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 80035 invoked by alias); 5 Apr 2016 17:54:37 -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 80024 invoked by uid 89); 5 Apr 2016 17:54:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=transferred X-HELO: usplmg20.ericsson.net Received: from usplmg20.ericsson.net (HELO usplmg20.ericsson.net) (198.24.6.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 05 Apr 2016 17:54:35 +0000 Received: from EUSAAHC003.ericsson.se (Unknown_Domain [147.117.188.81]) by usplmg20.ericsson.net (Symantec Mail Security) with SMTP id FB.7A.30335.FA5F3075; Tue, 5 Apr 2016 19:28:15 +0200 (CEST) Received: from [142.133.110.144] (147.117.188.8) by smtp-am.internal.ericsson.com (147.117.188.83) with Microsoft SMTP Server id 14.3.248.2; Tue, 5 Apr 2016 13:54:31 -0400 Subject: Re: [PATCH v2 1/2] Improve gdb_remote_download, remove gdb_download To: Pedro Alves , References: <1459794657-2087-1-git-send-email-simon.marchi@ericsson.com> <5703FA26.2080907@redhat.com> From: Simon Marchi Message-ID: <5703FBD7.7020706@ericsson.com> Date: Tue, 05 Apr 2016 17:54:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <5703FA26.2080907@redhat.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-04/txt/msg00095.txt.bz2 On 16-04-05 01:47 PM, Pedro Alves wrote: > 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". Fixed. >> +# 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" ?. Right. >> >> -# 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" ? Right. I tested this procedure with a remote host, but with the target being the same as the host, so it was working anyway... Fixed.