mirror of
https://github.com/PabloMK7/citra.git
synced 2025-09-11 05:10:05 +00:00
Cleanup new code, add docs and error handling
This commit is contained in:
parent
0d4c93d1c2
commit
6e45de760e
5 changed files with 112 additions and 59 deletions
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2022 Citra Emulator Project
|
||||
// Copyright 2023 Citra Emulator Project
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
|
@ -11,11 +11,14 @@
|
|||
namespace GDBStub {
|
||||
|
||||
/**
|
||||
* A request from a debugged application to perform some I/O with the GDB client.
|
||||
* This structure is also used to encode the reply back to the application.
|
||||
*
|
||||
* Based on the Rosalina implementation:
|
||||
* https://github.com/LumaTeam/Luma3DS/blob/master/sysmodules/rosalina/include/gdb.h#L46C27-L62
|
||||
*/
|
||||
struct PackedGdbHioRequest {
|
||||
char magic[4]; // "GDB\x00"
|
||||
char magic[4]; // "GDB\0"
|
||||
u32 version;
|
||||
|
||||
// Request
|
||||
|
@ -31,14 +34,24 @@ struct PackedGdbHioRequest {
|
|||
bool ctrl_c;
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the current HIO request to the given address. This is how the debugged
|
||||
* app indicates to the gdbstub that it wishes to perform a request.
|
||||
*
|
||||
* @param address The memory address of the \ref PackedGdbHioRequest.
|
||||
*/
|
||||
void SetHioRequest(const VAddr address);
|
||||
|
||||
bool HandleHioReply(const u8* const command_buffer, const u32 command_length);
|
||||
/**
|
||||
* If there is a pending HIO request, send it to the client.
|
||||
*
|
||||
* @returns whethere any request was sent to the client.
|
||||
*/
|
||||
bool HandlePendingHioRequestPacket();
|
||||
|
||||
bool HasPendingHioRequest();
|
||||
|
||||
bool WaitingForHioReply();
|
||||
|
||||
std::string BuildHioRequestPacket();
|
||||
/**
|
||||
* Process an HIO reply from the client.
|
||||
*/
|
||||
void HandleHioReply(const u8* const command_buffer, const u32 command_length);
|
||||
|
||||
} // namespace GDBStub
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue