From 4d635e7f2d41a23527caa33424a05a2ab9f1b473 Mon Sep 17 00:00:00 2001 From: Jonko <69772986+jonko0493@users.noreply.github.com> Date: Wed, 3 Sep 2025 08:38:33 -0700 Subject: [PATCH] fix: GDB stub reading wrong code for vCont packet (#2388) * fix: GDB stub reading wrong code for vCont packet * Implementation did contain bug, fixup --- src/debug/GdbCmds.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/debug/GdbCmds.cpp b/src/debug/GdbCmds.cpp index c2b1f9c48..1730efcf1 100644 --- a/src/debug/GdbCmds.cpp +++ b/src/debug/GdbCmds.cpp @@ -886,14 +886,14 @@ ExecResult GdbStub::Handle_v_MustReplyEmpty(GdbStub* stub, const u8* cmd, ssize_ ExecResult GdbStub::Handle_v_Cont(GdbStub* stub, const u8* cmd, ssize_t len) { - if (len < 1) + if (len < 2) { printf("insufficient length"); stub->RespStr("E01"); return ExecResult::Ok; } - switch (cmd[0]) + switch (cmd[1]) { case 'c': stub->RespStr("OK"); @@ -905,7 +905,7 @@ ExecResult GdbStub::Handle_v_Cont(GdbStub* stub, const u8* cmd, ssize_t len) stub->RespStr("OK"); return ExecResult::MustBreak; default: - printf("invalid continue %c %s\n", cmd[0], cmd); + printf("invalid continue %c %s\n", cmd[1], cmd); stub->RespStr("E01"); return ExecResult::Ok; }