mirror of https://github.com/RPCS3/rpcs3.git
SPU/PPU/Debugger: Ensure ascending stack frames (#13833)
* PPU/Debugger: Ensure ascending stack frames * SPU/Debugger: Ensure descending stack frame pointers
This commit is contained in:
parent
58140e1d3a
commit
db7f84f9f8
|
@ -1290,7 +1290,7 @@ std::vector<std::pair<u32, u32>> ppu_thread::dump_callstack_list() const
|
||||||
for (
|
for (
|
||||||
u64 sp = r1;
|
u64 sp = r1;
|
||||||
sp % 0x10 == 0u && sp >= stack_min && sp <= stack_max - ppu_stack_start_offset;
|
sp % 0x10 == 0u && sp >= stack_min && sp <= stack_max - ppu_stack_start_offset;
|
||||||
sp = *vm::get_super_ptr<u64>(static_cast<u32>(sp)), first = false
|
first = false
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
u64 addr = *vm::get_super_ptr<u64>(static_cast<u32>(sp + 16));
|
u64 addr = *vm::get_super_ptr<u64>(static_cast<u32>(sp + 16));
|
||||||
|
@ -1328,6 +1328,16 @@ std::vector<std::pair<u32, u32>> ppu_thread::dump_callstack_list() const
|
||||||
|
|
||||||
// TODO: function addresses too
|
// TODO: function addresses too
|
||||||
call_stack_list.emplace_back(static_cast<u32>(addr), static_cast<u32>(sp));
|
call_stack_list.emplace_back(static_cast<u32>(addr), static_cast<u32>(sp));
|
||||||
|
|
||||||
|
const u64 temp_sp = *vm::get_super_ptr<u64>(static_cast<u32>(sp));
|
||||||
|
|
||||||
|
if (temp_sp <= sp)
|
||||||
|
{
|
||||||
|
// Ensure inequality and that the old stack pointer is higher than current
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
sp = temp_sp;
|
||||||
}
|
}
|
||||||
|
|
||||||
return call_stack_list;
|
return call_stack_list;
|
||||||
|
|
|
@ -1182,7 +1182,7 @@ std::vector<std::pair<u32, u32>> spu_thread::dump_callstack_list() const
|
||||||
const v128 gpr0 = gpr[0];
|
const v128 gpr0 = gpr[0];
|
||||||
|
|
||||||
// Declare first 128-bytes as invalid for stack (common values such as 0 do not make sense here)
|
// Declare first 128-bytes as invalid for stack (common values such as 0 do not make sense here)
|
||||||
for (u32 sp = gpr[1]._u32[3]; (sp & 0xF) == 0u && sp >= 0x80u && sp <= 0x3FFE0u; sp = _ref<u32>(sp), first = false)
|
for (u32 sp = gpr[1]._u32[3]; (sp & 0xF) == 0u && sp >= 0x80u && sp <= 0x3FFE0u; first = false)
|
||||||
{
|
{
|
||||||
v128 lr = _ref<v128>(sp + 16);
|
v128 lr = _ref<v128>(sp + 16);
|
||||||
|
|
||||||
|
@ -1310,6 +1310,16 @@ std::vector<std::pair<u32, u32>> spu_thread::dump_callstack_list() const
|
||||||
|
|
||||||
// TODO: function addresses too
|
// TODO: function addresses too
|
||||||
call_stack_list.emplace_back(lr._u32[3], sp);
|
call_stack_list.emplace_back(lr._u32[3], sp);
|
||||||
|
|
||||||
|
const u32 temp_sp = _ref<u32>(sp);
|
||||||
|
|
||||||
|
if (temp_sp <= sp)
|
||||||
|
{
|
||||||
|
// Ensure ascending stack frame pointers
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
sp = temp_sp;
|
||||||
}
|
}
|
||||||
|
|
||||||
return call_stack_list;
|
return call_stack_list;
|
||||||
|
|
Loading…
Reference in New Issue