[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 27/41] gdbstub: don't fail on vCont; C04:0; c packets
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 27/41] gdbstub: don't fail on vCont; C04:0; c packets |
Date: |
Thu, 13 Jul 2017 16:24:20 +0200 |
From: Alex Bennée <address@hidden>
The thread-id of 0 means any CPU but we then ignore the fact we find
the first_cpu in this case who can have an index of 0. Instead of
bailing out just test if we have managed to match up thread-id to a
CPU.
Otherwise you get:
gdb_handle_packet: command='vCont;C04:0;c'
put_packet: reply='E22'
The actual reason for gdb sending vCont;C04:0;c was fixed in a
previous commit where we ensure the first_cpu's tid is correctly
reported to gdb however we should still behave correctly next time it
does send 0.
Signed-off-by: Alex Bennée <address@hidden>
Reviewed-by: Greg Kurz <address@hidden>
Reviewed-by: Claudio Imbrenda <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
gdbstub.c | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/gdbstub.c b/gdbstub.c
index 378fdd8..f936ddd 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -938,23 +938,16 @@ static int gdb_handle_vcont(GDBState *s, const char *p)
if (res) {
goto out;
}
- idx = tmp;
+
/* 0 means any thread, so we pick the first valid CPU */
- if (!idx) {
- idx = cpu_gdb_index(first_cpu);
- }
+ cpu = tmp ? find_cpu(tmp) : first_cpu;
- /*
- * If we are in user mode, the thread specified is actually a
- * thread id, and not an index. We need to find the actual
- * CPU first, and only then we can use its index.
- */
- cpu = find_cpu(idx);
/* invalid CPU/thread specified */
- if (!idx || !cpu) {
+ if (!cpu) {
res = -EINVAL;
goto out;
}
+
/* only use if no previous match occourred */
if (newstates[cpu->cpu_index] == 1) {
newstates[cpu->cpu_index] = cur_action;
--
1.8.3.1
- [Qemu-devel] [PULL 12/41] char: avoid chardevice direct access, (continued)
- [Qemu-devel] [PULL 12/41] char: avoid chardevice direct access, Paolo Bonzini, 2017/07/13
- [Qemu-devel] [PULL 16/41] test-char: add hotswap test, Paolo Bonzini, 2017/07/13
- [Qemu-devel] [PULL 14/41] test-char: split char_udp_test, Paolo Bonzini, 2017/07/13
- [Qemu-devel] [PULL 17/41] hmp: add hmp analogue for qmp-chardev-change, Paolo Bonzini, 2017/07/13
- [Qemu-devel] [PULL 15/41] test-char: split char_file_test, Paolo Bonzini, 2017/07/13
- [Qemu-devel] [PULL 19/41] serial: move TIOCM update to a separate function, Paolo Bonzini, 2017/07/13
- [Qemu-devel] [PULL 21/41] exec: use qemu_ram_ptr_length to access guest ram, Paolo Bonzini, 2017/07/13
- [Qemu-devel] [PULL 23/41] mttcg/i386: Patch instruction using async_safe_* framework, Paolo Bonzini, 2017/07/13
- [Qemu-devel] [PULL 27/41] gdbstub: don't fail on vCont; C04:0; c packets,
Paolo Bonzini <=
- [Qemu-devel] [PULL 25/41] gdbstub: rename cpu_index -> cpu_gdb_index, Paolo Bonzini, 2017/07/13
- [Qemu-devel] [PULL 28/41] chardev: fix parallel device can't be reconnect, Paolo Bonzini, 2017/07/13
- [Qemu-devel] [PULL 34/41] nbd: Simplify trace of client flags in negotiation, Paolo Bonzini, 2017/07/13
- [Qemu-devel] [PULL 35/41] nbd: Refactor reply to NBD_OPT_EXPORT_NAME, Paolo Bonzini, 2017/07/13
- [Qemu-devel] [PULL 36/41] nbd: Implement NBD_OPT_GO on server, Paolo Bonzini, 2017/07/13
- [Qemu-devel] [PULL 41/41] translate-all: remove redundant !tcg_enabled check in dump_exec_info, Paolo Bonzini, 2017/07/13
- [Qemu-devel] [PULL 09/41] char: add backend hotswap handler, Paolo Bonzini, 2017/07/13
- [Qemu-devel] [PULL 11/41] char: forbid direct chardevice access for hotswap devices, Paolo Bonzini, 2017/07/13
- [Qemu-devel] [PULL 18/41] virtio-console: chardev hotswap support, Paolo Bonzini, 2017/07/13
- [Qemu-devel] [PULL 20/41] serial: chardev hotswap support, Paolo Bonzini, 2017/07/13