Skip to content

Commit

Permalink
Debugger: Correct stack walk at start of func.
Browse files Browse the repository at this point in the history
  • Loading branch information
unknownbrackets committed Apr 9, 2023
1 parent d267008 commit a37f0c2
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Core/MIPS/MIPSStackWalk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,17 @@ namespace MIPSStackWalk {
const u32 LONGEST_FUNCTION = 1024 * 1024;
// TODO: Check if found entry is in the same symbol? Might be wrong sometimes...

if (entry != INVALIDTARGET && frame.pc == entry) {
// This happens when we're at the start of a function. Our ra is already correct.
frame.entry = entry;
// This function may consume stack, but the frame hasn't used it yet.
frame.stackSize = 0;
return true;
}

int ra_offset = -1;
const u32 start = frame.pc;
// Start one instruction before the current frame pc, as that hasn't run yet.
const u32 start = frame.pc - 4;
u32 stop = entry;
if (entry == INVALIDTARGET) {
if (start >= PSP_GetUserMemoryBase()) {
Expand Down Expand Up @@ -190,6 +199,4 @@ namespace MIPSStackWalk {

return frames;
}


};

0 comments on commit a37f0c2

Please sign in to comment.