This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/7] Introduce target_fileio_set_fs
- From: Pedro Alves <palves at redhat dot com>
- To: Doug Evans <dje at google dot com>
- Cc: Gary Benson <gbenson at redhat dot com>, gdb-patches <gdb-patches at sourceware dot org>
- Date: Fri, 17 Apr 2015 18:46:14 +0100
- Subject: Re: [PATCH 2/7] Introduce target_fileio_set_fs
- Authentication-results: sourceware.org; auth=none
- References: <1429186791-6867-1-git-send-email-gbenson at redhat dot com> <1429186791-6867-3-git-send-email-gbenson at redhat dot com> <CADPb22RVM=aT0+0e2679pW5az1VnwURTcQVc3T=eRo5V4tWoog at mail dot gmail dot com> <20150417133628 dot GA26681 at blade dot nx> <553116EB dot 6050508 at redhat dot com> <CADPb22RMFsZdEMz=yuECK7f5akhDwnJ_1d_thTD6+r_cUjad0Q at mail dot gmail dot com>
On 04/17/2015 06:28 PM, Doug Evans wrote:
> On Fri, Apr 17, 2015 at 7:21 AM, Pedro Alves <palves@redhat.com> wrote:
>> On 04/17/2015 02:36 PM, Gary Benson wrote:
>>
>>> It was basically because the alternative was to add a parameter to
>>> target_filesystem_is_local and target_fileio_{open,readlink,unlink}
>>> (and all their target vector implementations) to pass around whatever
>>> inferior you were talking about. You'd also have to make a lot more
>>> changes to the remote protocol: either vFile:{open,unlink,readlink}
>>> would need an extra argument (indicated with qSupported) or you'd need
>>> new "fs" versions of each packet. Both Pedro and I thought that was
>>> ugly.
>>
>> Right, this way mirrors what's done at the posix/system call level too,
>> and if some other systems needs something different for selecting
>> a "filesystem namespace", there's a single method/packet to change.
>
> Fair enough.
> All I would ask is that this get pushed down as far as possible in the
> call stack.
>
> E.g., while I wouldn't suggest massive changes to the remote protocol
> (regardless of how desperately IWBN), IWBN that layers above that
> follow good programming practices (avoiding using global state
> wherever possible/reasonable).
Fair enough as well. I'm fine with adding explicit arguments
on the layers above, leaving the packet as is.
Thanks,
Pedro Alves