MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / getStackFrameSize

Method getStackFrameSize

pcsx2/DebugTools/DebugInterface.cpp:114–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112}
113
114std::optional<u32> DebugInterface::getStackFrameSize(const ccc::Function& function)
115{
116 s32 stack_frame_size = function.stack_frame_size;
117
118 if (stack_frame_size < 0)
119 {
120 // The stack frame size isn't stored in the symbol table, so we try
121 // to extract it from the code by checking for an instruction at the
122 // start of the current function that is in the form of
123 // "addiu $sp, $sp, frame_size" instead.
124
125 u32 instruction = Read32(function.address().value);
126
127 if ((instruction & 0xffff0000) == 0x27bd0000)
128 stack_frame_size = -static_cast<s16>(instruction & 0xffff);
129
130 if (stack_frame_size < 0)
131 return std::nullopt;
132 }
133
134 return static_cast<u32>(stack_frame_size);
135}
136
137bool DebugInterface::evaluateExpression(const char* expression, u64& dest, std::string& error)
138{

Callers 1

parseUserInputMethod · 0.80

Calls 1

addressMethod · 0.80

Tested by

no test coverage detected