This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 6/9 v2] Implement mount namespace support for native Linux targets
- From: Gary Benson <gbenson at redhat dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches at sourceware dot org, Eli Zaretskii <eliz at gnu dot org>, Doug Evans <dje at google dot com>, Iago López Galeiras <iago at endocode dot com>
- Date: Wed, 27 May 2015 11:16:35 +0100
- Subject: Re: [PATCH 6/9 v2] Implement mount namespace support for native Linux targets
- Authentication-results: sourceware.org; auth=none
- References: <1429186791-6867-1-git-send-email-gbenson at redhat dot com> <1430395542-16017-7-git-send-email-gbenson at redhat dot com> <555DF2DA dot 3040703 at redhat dot com>
Pedro Alves wrote:
> On 04/30/2015 01:05 PM, Gary Benson wrote:
> > This commit allows GDB to access executables and shared libraries
> > on native Linux targets where GDB and the inferior have different
> > mount namespaces.
>
> > +/* Implementation of to_fileio_open. */
> > +
> > +static int
> > +linux_nat_fileio_open (struct target_ops *self,
> > + struct inferior *inf, const char *filename,
> > + int flags, int mode, int *target_errno)
> > +{
> > + int nat_flags;
> > + int fd;
> > +
> > + if (fileio_to_host_openflags (flags, &nat_flags) == -1)
> > + {
> > + *target_errno = FILEIO_EINVAL;
> > + return -1;
> > + }
> > +
> > + /* We do not need to convert MODE, since the fileio protocol
> > + uses the standard values. */
>
> Hmm, I'm not seeing how the fileio constants have to necessarily
> match the host's. So I don't understand this comment. What
> are these standard values?
Hmmm, I just copied this from inf_child_fileio_open. Maybe I should
fix that first, with some convertor function that the compiler can
essentially optimize away *if* the values really do match.
> Otherwise this looks good to me. I'll leave the "set debug" flag's
> name up to you.
Cool, thanks.
Cheers,
Gary
--
http://gbenson.net/