[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 02/12] gdbstub: Fix handler for 'F' packet
From: |
Alex Bennée |
Subject: |
[Qemu-devel] [PULL 02/12] gdbstub: Fix handler for 'F' packet |
Date: |
Mon, 2 Sep 2019 11:21:12 +0100 |
From: Sandra Loosemore <address@hidden>
Handling of the 'F' packet has been broken since commit
4b20fab101b9e2d0fb47454209637a17fc7a13d5, which converted it to use
the new packet parsing infrastructure. Per the GDB RSP specification
https://sourceware.org/gdb/current/onlinedocs/gdb/The-F-Reply-Packet.html
the second parameter may be omitted, but the rewritten implementation
was failing to recognize this case. The result was that QEMU was
repeatedly resending the fileio request and ignoring GDB's replies of
successful completion. This patch restores the behavior of the
previous code in allowing the errno parameter to be omitted and
passing 0 to the callback in that case.
Signed-off-by: Sandra Loosemore <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Alex Bennée <address@hidden>
diff --git a/gdbstub.c b/gdbstub.c
index 5c067594bae..4cf8af365e2 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1820,11 +1820,15 @@ static void handle_read_all_regs(GdbCmdContext
*gdb_ctx, void *user_ctx)
static void handle_file_io(GdbCmdContext *gdb_ctx, void *user_ctx)
{
- if (gdb_ctx->num_params >= 2 && gdb_ctx->s->current_syscall_cb) {
+ if (gdb_ctx->num_params >= 1 && gdb_ctx->s->current_syscall_cb) {
target_ulong ret, err;
ret = (target_ulong)gdb_ctx->params[0].val_ull;
- err = (target_ulong)gdb_ctx->params[1].val_ull;
+ if (gdb_ctx->num_params >= 2) {
+ err = (target_ulong)gdb_ctx->params[1].val_ull;
+ } else {
+ err = 0;
+ }
gdb_ctx->s->current_syscall_cb(gdb_ctx->s->c_cpu, ret, err);
gdb_ctx->s->current_syscall_cb = NULL;
}
--
2.20.1
- [Qemu-devel] [PULL 00/12] fixes for gdbstub, gitdm and testing, Alex Bennée, 2019/09/02
- [Qemu-devel] [PULL 01/12] gdbstub: Fix handling of '!' packet with new infra, Alex Bennée, 2019/09/02
- [Qemu-devel] [PULL 03/12] contrib/gitdm: filetype interface is not in order, fix, Alex Bennée, 2019/09/02
- [Qemu-devel] [PULL 02/12] gdbstub: Fix handler for 'F' packet,
Alex Bennée <=
- [Qemu-devel] [PULL 06/12] mailmap: Update philmd email address, Alex Bennée, 2019/09/02
- [Qemu-devel] [PULL 04/12] contrib/gitdm: Add address@hidden to group-map-redhat, Alex Bennée, 2019/09/02
- [Qemu-devel] [PULL 05/12] mailmap: Reorder by sections, Alex Bennée, 2019/09/02
- [Qemu-devel] [PULL 09/12] contrib/gitdm: Add RT-RK to the domain-map, Alex Bennée, 2019/09/02
- [Qemu-devel] [PULL 07/12] mailmap: Add many entries to improve 'git shortlog' statistics, Alex Bennée, 2019/09/02
- [Qemu-devel] [PULL 10/12] build-sys: build ui-spice-app as a module, Alex Bennée, 2019/09/02
- [Qemu-devel] [PULL 11/12] tests: fix modules-test with no default machine, Alex Bennée, 2019/09/02
- [Qemu-devel] [PULL 08/12] .mailmap/aliases: add some further commentary, Alex Bennée, 2019/09/02
- [Qemu-devel] [PULL 12/12] tests/docker: upgrade docker.py to python3, Alex Bennée, 2019/09/02
- Re: [Qemu-devel] [PULL 00/12] fixes for gdbstub, gitdm and testing, Peter Maydell, 2019/09/04