mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 21:30:19 -06:00
GDB Stub: properly check for wrong breakpoint type
Fix dolphin erroring out on requests to remove access watchpoints.
This commit is contained in:
@ -58,6 +58,8 @@ enum class BreakpointType
|
|||||||
Access,
|
Access,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
constexpr u32 NUM_BREAKPOINT_TYPES = 4;
|
||||||
|
|
||||||
const s64 GDB_UPDATE_CYCLES = 100000;
|
const s64 GDB_UPDATE_CYCLES = 100000;
|
||||||
|
|
||||||
static bool s_has_control = false;
|
static bool s_has_control = false;
|
||||||
@ -857,7 +859,7 @@ static void HandleAddBreakpoint()
|
|||||||
u32 i, addr = 0, len = 0;
|
u32 i, addr = 0, len = 0;
|
||||||
|
|
||||||
type = Hex2char(s_cmd_bfr[1]);
|
type = Hex2char(s_cmd_bfr[1]);
|
||||||
if (type > 4)
|
if (type > NUM_BREAKPOINT_TYPES)
|
||||||
return SendReply("E01");
|
return SendReply("E01");
|
||||||
|
|
||||||
i = 3;
|
i = 3;
|
||||||
@ -878,7 +880,7 @@ static void HandleRemoveBreakpoint()
|
|||||||
u32 type, addr, len, i;
|
u32 type, addr, len, i;
|
||||||
|
|
||||||
type = Hex2char(s_cmd_bfr[1]);
|
type = Hex2char(s_cmd_bfr[1]);
|
||||||
if (type >= 4)
|
if (type > NUM_BREAKPOINT_TYPES)
|
||||||
return SendReply("E01");
|
return SendReply("E01");
|
||||||
|
|
||||||
addr = 0;
|
addr = 0;
|
||||||
|
Reference in New Issue
Block a user