[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 22/22] gdbstub: do not split gdb_monitor_write payload
From: |
Alex Bennée |
Subject: |
[PATCH v6 22/22] gdbstub: do not split gdb_monitor_write payload |
Date: |
Wed, 5 Feb 2020 17:10:31 +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 b9fb8c0a95a..6e461d871e0 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 v6 06/22] target/arm: use gdb_get_reg helpers, (continued)
- [PATCH v6 06/22] target/arm: use gdb_get_reg helpers, Alex Bennée, 2020/02/05
- [PATCH v6 10/22] target/arm: prepare for multiple dynamic XMLs, Alex Bennée, 2020/02/05
- [PATCH v6 02/22] gdbstub: stop passing GDBState * around and use global, Alex Bennée, 2020/02/05
- [PATCH v6 16/22] configure: allow user to specify what gdb to use, Alex Bennée, 2020/02/05
- [PATCH v6 14/22] target/arm: don't bother with id_aa64pfr0_read for USER_ONLY, Alex Bennée, 2020/02/05
- [PATCH v6 13/22] target/arm: generate xml description of our SVE registers, Alex Bennée, 2020/02/05
- [PATCH v6 17/22] tests/guest-debug: add a simple test runner, Alex Bennée, 2020/02/05
- [PATCH v6 09/22] gdbstub: extend GByteArray to read register helpers, Alex Bennée, 2020/02/05
- [PATCH v6 22/22] gdbstub: do not split gdb_monitor_write payload,
Alex Bennée <=
- [PATCH v6 15/22] tests/tcg/aarch64: userspace system register test, Alex Bennée, 2020/02/05
- [PATCH v6 21/22] gdbstub: change GDBState.last_packet to GByteArray, Alex Bennée, 2020/02/05
- [PATCH v6 11/22] target/arm: explicitly encode regnum in our XML, Alex Bennée, 2020/02/05
- [PATCH v6 20/22] tests/tcg/aarch64: add test-sve-ioctl guest-debug test, Alex Bennée, 2020/02/05
- [PATCH v6 19/22] tests/tcg/aarch64: add SVE iotcl test, Alex Bennée, 2020/02/05
- [PATCH v6 12/22] target/arm: default SVE length to 64 bytes for linux-user, Alex Bennée, 2020/02/05
- [PATCH v6 18/22] tests/tcg/aarch64: add a gdbstub testcase for SVE registers, Alex Bennée, 2020/02/05
- Re: [PATCH v6 00/22] gdbstub refactor and SVE support, no-reply, 2020/02/05