This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 1/2] Improve gdb_remote_download, remove gdb_download
- From: Pedro Alves <palves at redhat dot com>
- To: Simon Marchi <simon dot marchi at ericsson dot com>, gdb-patches at sourceware dot org
- Date: Tue, 5 Apr 2016 18:47:18 +0100
- Subject: Re: [PATCH v2 1/2] Improve gdb_remote_download, remove gdb_download
- Authentication-results: sourceware.org; auth=none
- References: <1459794657-2087-1-git-send-email-simon dot marchi at ericsson dot com>
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