diff --git a/gdbstub.c b/gdbstub.c index c8375e3c3f..d3f1c6457e 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -2260,7 +2260,7 @@ static void handle_query_xfer_features(GArray *params, void *user_ctx) gdbserver_state.str_buf->len, true); } -#if defined(CONFIG_USER_ONLY) && defined(CONFIG_LINUX_USER) +#if defined(CONFIG_USER_ONLY) && (defined(CONFIG_LINUX_USER) || defined(CONFIG_BSD_USER)) static void handle_query_xfer_auxv(GArray *params, void *user_ctx) { TaskState *ts; @@ -2274,8 +2274,13 @@ static void handle_query_xfer_auxv(GArray *params, void *user_ctx) offset = get_param(params, 0)->val_ul; len = get_param(params, 1)->val_ul; ts = gdbserver_state.c_cpu->opaque; +#if defined(CONFIG_BSD_USER) + saved_auxv = 0; + auxv_len = 0; +#else saved_auxv = ts->info->saved_auxv; auxv_len = ts->info->auxv_len; +#endif if (offset >= auxv_len) { put_packet("E00"); @@ -2412,7 +2417,7 @@ static const GdbCmdParseEntry gdb_gen_query_table[] = { .cmd_startswith = 1, .schema = "s:l,l0" }, -#if defined(CONFIG_USER_ONLY) && defined(CONFIG_LINUX_USER) +#if defined(CONFIG_USER_ONLY) && (defined(CONFIG_LINUX_USER) || defined(CONFIG_BSD_USER)) { .handler = handle_query_xfer_auxv, .cmd = "Xfer:auxv:read::",