[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 27/28] gdbstub: do not split gdb_monitor_write payload
From: |
Alex Bennée |
Subject: |
[PATCH v1 27/28] gdbstub: do not split gdb_monitor_write payload |
Date: |
Mon, 16 Mar 2020 17:21:54 +0000 |
From: Damien Hedde <address@hidden>
Since we can now send packets of arbitrary length:
simplify gdb_monitor_write() and send the whole payload
in one packet.
Suggested-by: Luc Michel <address@hidden>
Signed-off-by: Damien Hedde <address@hidden>
Signed-off-by: Alex Bennée <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Message-Id: <address@hidden>
---
gdbstub.c | 23 +++--------------------
1 file changed, 3 insertions(+), 20 deletions(-)
diff --git a/gdbstub.c b/gdbstub.c
index a60ef5125eb..9ae148cd1ff 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -3200,28 +3200,11 @@ static void gdb_chr_event(void *opaque, QEMUChrEvent
event)
}
}
-static void gdb_monitor_output(const char *msg, int len)
-{
- g_autoptr(GString) buf = g_string_new("O");
- memtohex(buf, (uint8_t *)msg, len);
- put_packet(buf->str);
-}
-
static int gdb_monitor_write(Chardev *chr, const uint8_t *buf, int len)
{
- const char *p = (const char *)buf;
- int max_sz;
-
- max_sz = (MAX_PACKET_LENGTH / 2) + 1;
- for (;;) {
- if (len <= max_sz) {
- gdb_monitor_output(p, len);
- break;
- }
- gdb_monitor_output(p, max_sz);
- p += max_sz;
- len -= max_sz;
- }
+ g_autoptr(GString) hex_buf = g_string_new("O");
+ memtohex(hex_buf, buf, len);
+ put_packet(hex_buf->str);
return len;
}
--
2.20.1
- [PATCH v1 00/28 for 5.0] testing and gdbstub, Alex Bennée, 2020/03/16
- [PATCH v1 04/28] tests/docker: Update VirGL to v0.8.0, Alex Bennée, 2020/03/16
- [PATCH v1 03/28] tests/docker: Remove obsolete VirGL --with-glx configure option, Alex Bennée, 2020/03/16
- [PATCH v1 01/28] tests/docker: Install tools to cross-debug and build Linux kernels, Alex Bennée, 2020/03/16
- [PATCH v1 06/28] gdbstub: make GDBState static and have common init function, Alex Bennée, 2020/03/16
- [PATCH v1 02/28] tests/docker: Update VirGL git repository URL, Alex Bennée, 2020/03/16
- [PATCH v1 10/28] gdbstub: add helper for 128 bit registers, Alex Bennée, 2020/03/16
- [PATCH v1 08/28] gdbstub: move str_buf to GDBState and use GString, Alex Bennée, 2020/03/16
- [PATCH v1 05/28] travis.yml: Set G_MESSAGES_DEBUG do report GLib errors, Alex Bennée, 2020/03/16
- [PATCH v1 27/28] gdbstub: do not split gdb_monitor_write payload,
Alex Bennée <=
- [PATCH v1 11/28] target/arm: use gdb_get_reg helpers, Alex Bennée, 2020/03/16
- [PATCH v1 09/28] gdbstub: move mem_buf to GDBState and use GByteArray, Alex Bennée, 2020/03/16
- [PATCH v1 12/28] target/m68k: use gdb_get_reg helpers, Alex Bennée, 2020/03/16
- [PATCH v1 07/28] gdbstub: stop passing GDBState * around and use global, Alex Bennée, 2020/03/16
- [PATCH v1 13/28] target/i386: use gdb_get_reg helpers, Alex Bennée, 2020/03/16
- [PATCH v1 15/28] target/arm: prepare for multiple dynamic XMLs, Alex Bennée, 2020/03/16
- [PATCH v1 28/28] gdbstub: Fix single-step issue by confirming 'vContSupported+' feature to gdb, Alex Bennée, 2020/03/16