| 166 | } |
| 167 | |
| 168 | bool DetermineFrameInfo(DebugInterface* cpu, StackFrame& frame, u32 possibleEntry, u32 threadEntry, u32& ra) |
| 169 | { |
| 170 | if (ScanForEntry(cpu, frame, possibleEntry, ra)) |
| 171 | { |
| 172 | // Awesome, found one that looks right. |
| 173 | return true; |
| 174 | } |
| 175 | else if (ra != INVALIDTARGET && possibleEntry != INVALIDTARGET) |
| 176 | { |
| 177 | // Let's just assume it's a leaf. |
| 178 | frame.entry = possibleEntry; |
| 179 | frame.stackSize = 0; |
| 180 | return true; |
| 181 | } |
| 182 | |
| 183 | // Okay, we failed to get one. Our possibleEntry could be wrong, it often is. |
| 184 | // Let's just scan upward. |
| 185 | u32 newPossibleEntry = frame.pc > threadEntry ? threadEntry : frame.pc - MAX_FUNC_SIZE; |
| 186 | return ScanForEntry(cpu, frame, newPossibleEntry, ra); |
| 187 | } |
| 188 | |
| 189 | std::vector<StackFrame> Walk(DebugInterface* cpu, u32 pc, u32 ra, u32 sp, u32 threadEntry) |
| 190 | { |