Skip to content

Commit

Permalink
rework gdb packet parsing
Browse files Browse the repository at this point in the history
it should be a bit more robust now
  • Loading branch information
RSDuck committed Sep 15, 2024
1 parent 50d32f3 commit a3d6961
Show file tree
Hide file tree
Showing 5 changed files with 176 additions and 239 deletions.
6 changes: 5 additions & 1 deletion src/debug/GdbCmds.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@

#include <stdio.h>
#include <assert.h>
#include <string.h>

#include "../CRC32.h"
#include "../Platform.h"
#include "hexutil.h"

#include "GdbProto.h"
#include "GdbStub.h"

using namespace melonDS;
using Platform::Log;
Expand Down Expand Up @@ -878,6 +879,7 @@ ExecResult GdbStub::Handle_v_Stopped(GdbStub* stub, const u8* cmd, ssize_t len)

ExecResult GdbStub::Handle_v_MustReplyEmpty(GdbStub* stub, const u8* cmd, ssize_t len)
{
printf("must reply empty\n");
stub->Resp(NULL, 0);
return ExecResult::Ok;
}
Expand All @@ -886,6 +888,7 @@ ExecResult GdbStub::Handle_v_Cont(GdbStub* stub, const u8* cmd, ssize_t len)
{
if (len < 1)
{
printf("insufficient length");
stub->RespStr("E01");
return ExecResult::Ok;
}
Expand All @@ -902,6 +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);
stub->RespStr("E01");
return ExecResult::Ok;
}
Expand Down
Loading

0 comments on commit a3d6961

Please sign in to comment.