Re: [PATCH] Make file transfer commands work with all (native) targets.

Pedro Alves
2013-06-28T18:26:04Z

On 06/28/2013 06:44 PM, Eli Zaretskii wrote:
>> Date: Fri, 28 Jun 2013 17:33:58 +0100
>> From: Pedro Alves <palves@redhat.com>
>> CC: gdb-patches@sourceware.org
>>
>>> Pedro> remote_file_get could nowadays be using the target_fileio_XXX methods
>>> Pedro> instead of remote_hostio_XXX, and therefore the command could be
>>> Pedro> generalized to work with all targets.
>>
>> Actually, doing this is quite easy, so I went ahead, in the name
>> of local/remote feature parity. We can connect to a local gdbserver
>> and do file transfer in the local system; there seems to be no
>> reason we can't do it with native debugging too.
>>
>> WDYT?
>
> What is the use case?

Yeah, I admit it fits more in the general "as fewer differences
we have between local/remote debugging, the better" theme than
driven by a particular use case. A possible example would be something
like gdb scripts working the same whether connected to a remote
or local target (and unaware of whether the local target is implemented
by local gdbserver or the native built-in target).

> Without a good use case, having "remote get" serve like a poor man's
> 'cp' is confusing, IMO.

Would you be OK with, or prefer, adding "target get/put/delete", leaving
the "remote" variants in place? The difference between the "target" and
"remote" variants would be that the former would work with any target,
while the later would still only work with the remote target.

--
Pedro Alves