This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Move vgdb special case into remote_filesystem_is_local
- From: Gary Benson <gbenson at redhat dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 15 May 2015 14:19:15 +0100
- Subject: Re: [PATCH] Move vgdb special case into remote_filesystem_is_local
- Authentication-results: sourceware.org; auth=none
- References: <1430146276-15606-1-git-send-email-gbenson at redhat dot com> <55547C8B dot 5050000 at redhat dot com> <20150515090211 dot GA13085 at blade dot nx> <5555D94D dot 6020606 at redhat dot com>
Pedro Alves wrote:
> On 05/15/2015 10:02 AM, Gary Benson wrote:
> > Pedro Alves wrote:
> > > On 04/27/2015 03:51 PM, Gary Benson wrote:
> > > > Valgrind GDB (vgdb) presents itself as a remote target but
> > > > works on the local filesystem. gdb_bfd_open contained a
> > > > special case to make vgdb work with "target:" sysroots, but
> > > > the implementation meant that GDB would fall back to the local
> > > > filesystem if *any* to_fileio_open method failed with ENOSYS
> > > > for *any* reason.
> > >
> > > Can you give an example target where we'd want this to behave
> > > differently?
> > >
> > > E.g,. what should happen with "target sim" ?
> >
> > I don't understand what you're asking. "target sim" doesn't use
> > remote_filesystem_is_local, (to_filesystem_is_local for sim is the
> > default, tdefault_filesystem_is_local, which returns 1 always).
>
> When you say:
>
> gdb_bfd_open contained a special case
> to make vgdb work with "target:" sysroots, but the implementation
> meant that GDB would fall back to the local filesystem if *any*
> to_fileio_open method failed with ENOSYS for *any* reason.
>
> I'd prefer to get an example target for one of those "if *any*
> to_fileio_open ... *any* reason". I'd like to understand the
> real motivation for the change. Because otherwise I get to
> wonder why would we handle any other target that goes through
> this path differently.
Ah, ok, I get what you're asking.
In what's upstream right now, the only path (I think) that you
can get to the point in gdb_bfd_open with the workaround is if
you're using a remote target that doesn't support file retrieval.
But, in the namespace-awareness series I posted, target_fileio_open
can fail with ENOSYS if setns is not available. That's the reason
I made the change.
Thanks,
Gary
--
http://gbenson.net/