Re: [PATCH 6/9 v2] Implement mount namespace support for native Linux targets

Gary Benson
2015-05-27T10:16:42Z

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

--