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 <richard.hender...@linaro.org>
> ---
>  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.  */
> 

Reply via email to