Initial port of luma3ds' gdb_hio to Citra

This commit is contained in:
Ian Chamberlain 2022-12-02 19:31:31 -06:00
parent 5346ca27b5
commit 6f23ee43ae
No known key found for this signature in database
GPG key ID: AE5484D09405AA60
5 changed files with 212 additions and 2 deletions

View file

@ -35,6 +35,7 @@
#include "core/arm/arm_interface.h"
#include "core/core.h"
#include "core/gdbstub/gdbstub.h"
#include "core/gdbstub/hio.h"
#include "core/hle/kernel/process.h"
#include "core/loader/loader.h"
#include "core/memory.h"
@ -1061,6 +1062,19 @@ void HandlePacket() {
LOG_DEBUG(Debug_GDBStub, "Packet: {}", command_buffer[0]);
// HACK: instead of polling DebugEvents properly via SVC, just check for
// whether there's a pending a request, and send it if so.
switch (command_buffer[0]) {
case 'c':
case 'C':
case 's':
if (HasHioRequest()) {
const auto reply = BuildHioReply();
SendReply(reply.data());
return;
}
}
switch (command_buffer[0]) {
case 'q':
HandleQuery();
@ -1075,6 +1089,11 @@ void HandlePacket() {
Shutdown();
LOG_INFO(Debug_GDBStub, "killed by gdb");
return;
case 'F':
if (HandleHioRequest(command_buffer, command_length)) {
Continue();
};
break;
case 'g':
ReadRegisters();
break;