X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=gdbstub.c;h=b470aec8eaecc31aebc52ce891bb8ba36f0c03ce;hb=7a3e957177c18917cf713d7e366fa6aca351da1f;hp=687c02e598a81ee3040ceb4e74e8a0dc4fbc9c6f;hpb=f34edbc760b0f689deddd175fc08732ecb46665f;p=mirror_qemu.git diff --git a/gdbstub.c b/gdbstub.c index 687c02e598..b470aec8ea 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -1,6 +1,10 @@ /* * gdb server stub * + * This implements a subset of the remote protocol as described in: + * + * https://sourceware.org/gdb/onlinedocs/gdb/Remote-Protocol.html + * * Copyright (c) 2003-2005 Fabrice Bellard * * This library is free software; you can redistribute it and/or @@ -15,6 +19,8 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, see . + * + * SPDX-License-Identifier: LGPL-2.0+ */ #include "qemu/osdep.h" @@ -1667,12 +1673,23 @@ static void handle_remove_bp(GdbCmdContext *gdb_ctx, void *user_ctx) put_packet(gdb_ctx->s, "E22"); } +/* + * handle_set/get_reg + * + * Older gdb are really dumb, and don't use 'G/g' if 'P/p' is available. + * This works, but can be very slow. Anything new enough to understand + * XML also knows how to use this properly. However to use this we + * need to define a local XML file as well as be talking to a + * reasonably modern gdb. Responding with an empty packet will cause + * the remote gdb to fallback to older methods. + */ + static void handle_set_reg(GdbCmdContext *gdb_ctx, void *user_ctx) { int reg_size; if (!gdb_has_xml) { - put_packet(gdb_ctx->s, "E00"); + put_packet(gdb_ctx->s, ""); return; } @@ -1692,11 +1709,6 @@ static void handle_get_reg(GdbCmdContext *gdb_ctx, void *user_ctx) { int reg_size; - /* - * Older gdb are really dumb, and don't use 'g' if 'p' is avaialable. - * This works, but can be very slow. Anything new enough to - * understand XML also knows how to use this properly. - */ if (!gdb_has_xml) { put_packet(gdb_ctx->s, ""); return;