[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/6] gdbstub: Return the fd from gdbserver_start
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-devel] [PATCH 1/6] gdbstub: Return the fd from gdbserver_start |
Date: |
Thu, 31 May 2018 20:15:58 -0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 |
Hi Richard,
On 05/31/2018 07:49 PM, Richard Henderson wrote:
> This will allow us to protect gdbserver_fd from the guest.
>
> Signed-off-by: Richard Henderson <address@hidden>
> ---
> gdbstub.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/gdbstub.c b/gdbstub.c
> index 6081e719c5..057d0d65c5 100644
> --- a/gdbstub.c
> +++ b/gdbstub.c
> @@ -1890,15 +1890,16 @@ static int gdbserver_open(int port)
> int gdbserver_start(int port)
> {
> gdbserver_fd = gdbserver_open(port);
> - if (gdbserver_fd < 0)
> + if (gdbserver_fd < 0) {
> return -1;
> + }
> /* accept connections */
> if (!gdb_accept()) {
> close(gdbserver_fd);
> gdbserver_fd = -1;
> return -1;
> }
> - return 0;
> + return gdbserver_fd;
I agree with your change, but what about !CONFIG_USER_ONLY?
It should be safe enough documenting the different behaviors in
include/exec/gdbstub.h.
> }
>
> /* Disable gdb stub for child processes. */
>
- [Qemu-devel] [PATCH v5 0/6] linux-user: Reorg interp_prefix handling, Richard Henderson, 2018/05/31
- [Qemu-devel] [PATCH 1/6] gdbstub: Return the fd from gdbserver_start, Richard Henderson, 2018/05/31
- Re: [Qemu-devel] [PATCH 1/6] gdbstub: Return the fd from gdbserver_start,
Philippe Mathieu-Daudé <=
- [Qemu-devel] [PATCH 2/6] linux-user: Add host_fds and manipulators, Richard Henderson, 2018/05/31
- [Qemu-devel] [PATCH 4/6] linux-user: Check contains_hostfd in select syscalls, Richard Henderson, 2018/05/31
- [Qemu-devel] [PATCH 5/6] linux-user: Check is_hostfd in mmap syscalls, Richard Henderson, 2018/05/31
- [Qemu-devel] [PATCH 3/6] linux-user: Check is_hostfd in do_syscall, Richard Henderson, 2018/05/31
- [Qemu-devel] [PATCH 6/6] linux-user: Use *at functions to implement interp_prefix, Richard Henderson, 2018/05/31
- Re: [Qemu-devel] [PATCH v5 0/6] linux-user: Reorg interp_prefix handling, no-reply, 2018/05/31