Skip to content

Commit

Permalink
MipsStackWalk: Fix IOP stack walking
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziemas authored and refractionpcsx2 committed Oct 26, 2023
1 parent e19c9a9 commit 715bc94
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions pcsx2/DebugTools/MipsStackWalk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ namespace MipsStackWalk
return false;
}

bool IsJRInstr(const R5900::OPCODE& op)
{
if ((op.flags & IS_BRANCH) && (op.flags & BRANCHTYPE_REGISTER))
{
return true;
}

return false;
}

bool IsAddImmInstr(const R5900::OPCODE& op)
{
if (op.flags & IS_ALU)
Expand Down Expand Up @@ -114,21 +124,12 @@ namespace MipsStackWalk
int ra_offset = -1;
const u32 start = frame.pc;
u32 stop = entry;

if (entry == INVALIDTARGET)
{
/* if (start >= PSP_GetUserMemoryBase()) {
stop = PSP_GetUserMemoryBase();
} else if (start >= PSP_GetKernelMemoryBase()) {
stop = PSP_GetKernelMemoryBase();
} else if (start >= PSP_GetScratchpadMemoryBase()) {
stop = PSP_GetScratchpadMemoryBase();
}*/
stop = 0x80000;
}
if (stop < start - LONGEST_FUNCTION)
{
stop = start - LONGEST_FUNCTION;
stop = std::max<s64>(0, (s64)start - LONGEST_FUNCTION);
}

for (u32 pc = start; cpu->isValidAddress(pc) && pc >= stop; pc -= 4)
{
u32 rawOp = cpu->read32(pc);
Expand Down

0 comments on commit 715bc94

Please sign in to comment.