This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] gdbserver-base.exp: Copy file to standard output directory in ${board}_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
- Cc: qiyaoltc at gmail dot com
- Date: Tue, 12 Apr 2016 19:45:54 +0100
- Subject: Re: [PATCH] gdbserver-base.exp: Copy file to standard output directory in ${board}_download
- Authentication-results: sourceware.org; auth=none
- References: <1460483287-23953-1-git-send-email-simon dot marchi at ericsson dot com> <570D39A7 dot 7040001 at redhat dot com> <570D403F dot 5010406 at ericsson dot com>
On 04/12/2016 07:36 PM, Simon Marchi wrote:
> On 16-04-12 02:08 PM, Pedro Alves wrote:
>> On 04/12/2016 06:48 PM, Simon Marchi wrote:
>>
>>> proc ${board}_download { board host dest } {
>>> + file copy -force $host [standard_output_file $dest]
>>> return $host
>>> }
>>
>> I think this should be:
>>
>> set dest [standard_output_file $dest]
>> file copy -force $host $dest
>> return $dest
>
> Doh, you're right.
>
>> Don't we need to consider the case of $dest being an absolute path?
>
> I thought it wouldn't be better not, since we don't even want for tests to
> be able to write outside the standard output directory. I guess that if a
> test tries to download to /foo/bar, it will end up as
> outputs/gdb.blah/thetest/foo/bar. Then I would say the test would be at fault.
OK, but I think we should put a comment to the effect in place. After all,
we'll be pointing other people that run into this in their boards to this
commit. :-)
Otherwise LGTM. (Let's wait a bit to give Yao a chance to comment though.)
Thanks,
Pedro Alves