mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 05:19:56 +00:00
Merge pull request #17423 from unknownbrackets/debugger
Debugger: Correct PC if replacement breaks
This commit is contained in:
commit
13815e6f5a
@ -411,6 +411,9 @@ static inline bool MergeRecentMemInfo(const PendingNotifyMem &info, size_t copyL
|
||||
|
||||
for (size_t i = 1; i <= 4; ++i) {
|
||||
auto &prev = pendingNotifies[pendingNotifies.size() - i];
|
||||
if (prev.flags != info.flags)
|
||||
continue;
|
||||
|
||||
if (prev.start >= info.start + info.size || prev.start + prev.size <= info.start)
|
||||
continue;
|
||||
|
||||
|
@ -519,6 +519,14 @@ bool ArmJit::ReplaceJalTo(u32 dest) {
|
||||
js.compilerPC += 4;
|
||||
// No writing exits, keep going!
|
||||
|
||||
if (CBreakPoints::HasMemChecks()) {
|
||||
// We could modify coreState, so we need to write PC and check.
|
||||
// Otherwise, PC may end up on the jal. We add 4 to skip the delay slot.
|
||||
FlushAll();
|
||||
WriteExit(GetCompilerPC() + 4, js.nextExit++);
|
||||
js.compiling = false;
|
||||
}
|
||||
|
||||
// Add a trigger so that if the inlined code changes, we invalidate this block.
|
||||
blocks.ProxyBlock(js.blockStart, dest, funcSize / sizeof(u32), GetCodePtr());
|
||||
#endif
|
||||
|
@ -520,6 +520,14 @@ bool Arm64Jit::ReplaceJalTo(u32 dest) {
|
||||
js.compilerPC += 4;
|
||||
// No writing exits, keep going!
|
||||
|
||||
if (CBreakPoints::HasMemChecks()) {
|
||||
// We could modify coreState, so we need to write PC and check.
|
||||
// Otherwise, PC may end up on the jal. We add 4 to skip the delay slot.
|
||||
FlushAll();
|
||||
WriteExit(GetCompilerPC() + 4, js.nextExit++);
|
||||
js.compiling = false;
|
||||
}
|
||||
|
||||
// Add a trigger so that if the inlined code changes, we invalidate this block.
|
||||
blocks.ProxyBlock(js.blockStart, dest, funcSize / sizeof(u32), GetCodePtr());
|
||||
#endif
|
||||
|
@ -565,6 +565,13 @@ bool Jit::ReplaceJalTo(u32 dest) {
|
||||
js.compilerPC += 4;
|
||||
// No writing exits, keep going!
|
||||
|
||||
if (CBreakPoints::HasMemChecks()) {
|
||||
// We could modify coreState, so we need to write PC and check.
|
||||
// Otherwise, PC may end up on the jal. We add 4 to skip the delay slot.
|
||||
MOV(32, MIPSSTATE_VAR(pc), Imm32(GetCompilerPC() + 4));
|
||||
js.afterOp |= JitState::AFTER_CORE_STATE;
|
||||
}
|
||||
|
||||
// Add a trigger so that if the inlined code changes, we invalidate this block.
|
||||
blocks.ProxyBlock(js.blockStart, dest, funcSize / sizeof(u32), GetCodePtr());
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user