diff mbox series

[RFC] gdbstub: don't report auxv feature unless on Linux

Message ID 20230403120250.2071560-1-alex.bennee@linaro.org
State New
Headers show
Series [RFC] gdbstub: don't report auxv feature unless on Linux | expand

Commit Message

Alex Bennée April 3, 2023, 12:02 p.m. UTC
The later handler if conditionally compiled only for Linux but we
forgot to ensure we don't advertise it lest we confuse our BSD
brethren.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 gdbstub/gdbstub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Philippe Mathieu-Daudé April 3, 2023, 12:37 p.m. UTC | #1
On 3/4/23 14:02, Alex Bennée wrote:
> The later handler if conditionally compiled only for Linux but we
> forgot to ensure we don't advertise it lest we confuse our BSD
> brethren.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>   gdbstub/gdbstub.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c
> index 2a66371aa5..0760d78685 100644
> --- a/gdbstub/gdbstub.c
> +++ b/gdbstub/gdbstub.c
> @@ -1468,7 +1468,7 @@ static void handle_query_supported(GArray *params, void *user_ctx)
>               ";ReverseStep+;ReverseContinue+");
>       }
>   
> -#ifdef CONFIG_USER_ONLY
> +#if defined(CONFIG_USER_ONLY) && defined(CONFIG_LINUX)
>       if (gdbserver_state.c_cpu->opaque) {
>           g_string_append(gdbserver_state.str_buf, ";qXfer:auxv:read+");
>       }

Fixes: 51c623b0de ("gdbstub: add support to Xfer:auxv:read: packet")
Reported-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Warner Losh April 3, 2023, 12:51 p.m. UTC | #2
On Mon, Apr 3, 2023, 6:37 AM Philippe Mathieu-Daudé <philmd@linaro.org>
wrote:

> On 3/4/23 14:02, Alex Bennée wrote:
> > The later handler if conditionally compiled only for Linux but we
> > forgot to ensure we don't advertise it lest we confuse our BSD
> > brethren.
> >
> > Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> > ---
> >   gdbstub/gdbstub.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c
> > index 2a66371aa5..0760d78685 100644
> > --- a/gdbstub/gdbstub.c
> > +++ b/gdbstub/gdbstub.c
> > @@ -1468,7 +1468,7 @@ static void handle_query_supported(GArray *params,
> void *user_ctx)
> >               ";ReverseStep+;ReverseContinue+");
> >       }
> >
> > -#ifdef CONFIG_USER_ONLY
> > +#if defined(CONFIG_USER_ONLY) && defined(CONFIG_LINUX)
> >       if (gdbserver_state.c_cpu->opaque) {
> >           g_string_append(gdbserver_state.str_buf, ";qXfer:auxv:read+");
> >       }
>
> Fixes: 51c623b0de ("gdbstub: add support to Xfer:auxv:read: packet")
> Reported-by: Warner Losh <imp@bsdimp.com>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>

Reviewed-by: Warner Losh <imp@bsdimp.com>
Tested-by: Warner Losh <imp@bsdimp.com>

I can debug with this now. Cross debugging of binaries in a chroot with gdb
has issues though... that's orthogonal to this patch...

Warner

>
diff mbox series

Patch

diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c
index 2a66371aa5..0760d78685 100644
--- a/gdbstub/gdbstub.c
+++ b/gdbstub/gdbstub.c
@@ -1468,7 +1468,7 @@  static void handle_query_supported(GArray *params, void *user_ctx)
             ";ReverseStep+;ReverseContinue+");
     }
 
-#ifdef CONFIG_USER_ONLY
+#if defined(CONFIG_USER_ONLY) && defined(CONFIG_LINUX)
     if (gdbserver_state.c_cpu->opaque) {
         g_string_append(gdbserver_state.str_buf, ";qXfer:auxv:read+");
     }