mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-18 08:50:29 +02:00
Make CBreakpoints an object
This commit is contained in:
1 parent
f692092159
commit
7992ff4627
26 files changed
+252
-258
No files matched your search
@@ -94,18 +94,18 @@ struct WebSocketCPUBreakpointParams {
|
||||
cond.debug = currentDebugMIPS;
|
||||
cond.expressionString = condition;
|
||||
cond.expression = compiledCondition;
|
||||
CBreakPoints::ChangeBreakPointAddCond(address, cond);
|
||||
g_breakpoints.ChangeBreakPointAddCond(address, cond);
|
||||
} else if (hasCondition && condition.empty()) {
|
||||
CBreakPoints::ChangeBreakPointRemoveCond(address);
|
||||
g_breakpoints.ChangeBreakPointRemoveCond(address);
|
||||
}
|
||||
|
||||
if (hasLogFormat) {
|
||||
CBreakPoints::ChangeBreakPointLogFormat(address, logFormat);
|
||||
g_breakpoints.ChangeBreakPointLogFormat(address, logFormat);
|
||||
}
|
||||
|
||||
// TODO: Fix this interface.
|
||||
if (hasLog && !hasEnabled) {
|
||||
CBreakPoints::IsAddressBreakPoint(address, &enabled);
|
||||
g_breakpoints.IsAddressBreakPoint(address, &enabled);
|
||||
hasEnabled = true;
|
||||
}
|
||||
if (hasLog && hasEnabled) {
|
||||
@@ -114,9 +114,9 @@ struct WebSocketCPUBreakpointParams {
|
||||
result |= BREAK_ACTION_LOG;
|
||||
if (enabled)
|
||||
result |= BREAK_ACTION_PAUSE;
|
||||
CBreakPoints::ChangeBreakPoint(address, result);
|
||||
g_breakpoints.ChangeBreakPoint(address, result);
|
||||
} else if (hasEnabled) {
|
||||
CBreakPoints::ChangeBreakPoint(address, enabled);
|
||||
g_breakpoints.ChangeBreakPoint(address, enabled);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -138,7 +138,7 @@ void WebSocketCPUBreakpointAdd(DebuggerRequest &req) {
|
||||
if (!params.Parse(req))
|
||||
return;
|
||||
|
||||
CBreakPoints::AddBreakPoint(params.address);
|
||||
g_breakpoints.AddBreakPoint(params.address);
|
||||
params.Apply();
|
||||
req.Respond();
|
||||
}
|
||||
@@ -158,7 +158,7 @@ void WebSocketCPUBreakpointUpdate(DebuggerRequest &req) {
|
||||
if (!params.Parse(req))
|
||||
return;
|
||||
bool enabled;
|
||||
if (!CBreakPoints::IsAddressBreakPoint(params.address, &enabled))
|
||||
if (!g_breakpoints.IsAddressBreakPoint(params.address, &enabled))
|
||||
return req.Fail("Breakpoint not found");
|
||||
|
||||
params.Apply();
|
||||
@@ -180,7 +180,7 @@ void WebSocketCPUBreakpointRemove(DebuggerRequest &req) {
|
||||
if (!req.ParamU32("address", &address))
|
||||
return;
|
||||
|
||||
CBreakPoints::RemoveBreakPoint(address);
|
||||
g_breakpoints.RemoveBreakPoint(address);
|
||||
req.Respond();
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ void WebSocketCPUBreakpointList(DebuggerRequest &req) {
|
||||
|
||||
JsonWriter &json = req.Respond();
|
||||
json.pushArray("breakpoints");
|
||||
auto bps = CBreakPoints::GetBreakpoints();
|
||||
auto bps = g_breakpoints.GetBreakpoints();
|
||||
for (const auto &bp : bps) {
|
||||
if (bp.temporary)
|
||||
continue;
|
||||
@@ -312,7 +312,7 @@ struct WebSocketMemoryBreakpointParams {
|
||||
bits = (enabled ? BREAK_ACTION_PAUSE : 0) | (log ? BREAK_ACTION_LOG : 0);
|
||||
} else {
|
||||
MemCheck prev;
|
||||
if (CBreakPoints::GetMemCheck(address, end, &prev))
|
||||
if (g_breakpoints.GetMemCheck(address, end, &prev))
|
||||
bits = prev.result;
|
||||
|
||||
if (hasEnabled)
|
||||
@@ -330,12 +330,12 @@ struct WebSocketMemoryBreakpointParams {
|
||||
cond.debug = currentDebugMIPS;
|
||||
cond.expressionString = condition;
|
||||
cond.expression = compiledCondition;
|
||||
CBreakPoints::ChangeMemCheckAddCond(address, end, cond);
|
||||
g_breakpoints.ChangeMemCheckAddCond(address, end, cond);
|
||||
} else if (hasCondition && condition.empty()) {
|
||||
CBreakPoints::ChangeMemCheckRemoveCond(address, end);
|
||||
g_breakpoints.ChangeMemCheckRemoveCond(address, end);
|
||||
}
|
||||
if (hasLogFormat) {
|
||||
CBreakPoints::ChangeMemCheckLogFormat(address, end, logFormat);
|
||||
g_breakpoints.ChangeMemCheckLogFormat(address, end, logFormat);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -362,7 +362,7 @@ void WebSocketMemoryBreakpointAdd(DebuggerRequest &req) {
|
||||
if (!params.Parse(req))
|
||||
return;
|
||||
|
||||
CBreakPoints::AddMemCheck(params.address, params.end, params.cond, params.Result(true));
|
||||
g_breakpoints.AddMemCheck(params.address, params.end, params.cond, params.Result(true));
|
||||
params.Apply();
|
||||
req.Respond();
|
||||
}
|
||||
@@ -388,10 +388,10 @@ void WebSocketMemoryBreakpointUpdate(DebuggerRequest &req) {
|
||||
return;
|
||||
|
||||
MemCheck mc;
|
||||
if (!CBreakPoints::GetMemCheck(params.address, params.end, &mc))
|
||||
if (!g_breakpoints.GetMemCheck(params.address, params.end, &mc))
|
||||
return req.Fail("Breakpoint not found");
|
||||
|
||||
CBreakPoints::ChangeMemCheck(params.address, params.end, params.cond, params.Result(true));
|
||||
g_breakpoints.ChangeMemCheck(params.address, params.end, params.cond, params.Result(true));
|
||||
params.Apply();
|
||||
req.Respond();
|
||||
}
|
||||
@@ -415,7 +415,7 @@ void WebSocketMemoryBreakpointRemove(DebuggerRequest &req) {
|
||||
if (!req.ParamU32("size", &size))
|
||||
return;
|
||||
|
||||
CBreakPoints::RemoveMemCheck(address, size == 0 ? 0 : address + size);
|
||||
g_breakpoints.RemoveMemCheck(address, size == 0 ? 0 : address + size);
|
||||
req.Respond();
|
||||
}
|
||||
|
||||
@@ -443,7 +443,7 @@ void WebSocketMemoryBreakpointList(DebuggerRequest &req) {
|
||||
|
||||
JsonWriter &json = req.Respond();
|
||||
json.pushArray("breakpoints");
|
||||
auto mcs = CBreakPoints::GetMemChecks();
|
||||
auto mcs = g_breakpoints.GetMemChecks();
|
||||
for (const auto &mc : mcs) {
|
||||
json.pushDict();
|
||||
json.writeUint("address", mc.start);
|
||||
|
||||
Reference in new issue
Block a user