Debugger: Correct stack walk at start of func.

This commit is contained in:
Unknown W. Brackets 2023-04-09 15:59:12 -07:00
parent d26700820c
commit a37f0c256d

View File

@ -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()) {
@ -190,6 +199,4 @@ namespace MIPSStackWalk {
return frames;
}
};