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: Pedro Alves <palves at redhat dot com>
- To: Gary Benson <gbenson at redhat dot com>, gdb-patches at sourceware dot org
- Cc: Eli Zaretskii <eliz at gnu dot org>, Doug Evans <dje at google dot com>, Iago López Galeiras <iago at endocode dot com>
- Date: Thu, 21 May 2015 15:59:38 +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>
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?
> + fd = linux_mntns_open_cloexec (linux_nat_fileio_pid_of (inf),
> + filename, nat_flags, mode);
> + if (fd == -1)
> + *target_errno = host_to_fileio_error (errno);
> +
> + return fd;
> +}
> +
Otherwise this looks good to me. I'll leave the "set debug" flag's
name up to you.
Thanks,
Pedro Alves