Use architecture to determine correct frame pointer comparison.

This commit is contained in:
Rene Gollent
2011-12-12 08:41:45 -05:00
parent 4b64cd3de3
commit f67acc2c72
+20 -14
View File
@@ -572,21 +572,27 @@ ThreadHandler::_HandleBreakpointHitStep(CpuState* cpuState)
return false; return false;
case STEP_OUT: case STEP_OUT:
{ {
// That's the return address, so we're done in theory, // That's the return address, so we're done in theory,
// unless we're a recursive function. Check if we've actually // unless we're a recursive function. Check if we've actually
// exited the previous stack frame or not. // exited the previous stack frame or not.
if (cpuState->StackFramePointer() <= fPreviousFrameAddress) { target_addr_t framePointer = cpuState->StackFramePointer();
status_t error = _InstallTemporaryBreakpoint( bool hasExitedFrame = fDebuggerInterface->GetArchitecture()
cpuState->InstructionPointer()); ->StackGrowthDirection() == STACK_GROWTH_DIRECTION_POSITIVE
if (error != B_OK) ? framePointer < fPreviousFrameAddress
_StepFallback(); : framePointer > fPreviousFrameAddress;
else
_RunThread(cpuState->InstructionPointer()); if (!hasExitedFrame) {
return true; status_t error = _InstallTemporaryBreakpoint(
} cpuState->InstructionPointer());
fPreviousFrameAddress = 0; if (error != B_OK)
_StepFallback();
else
_RunThread(cpuState->InstructionPointer());
return true;
} }
fPreviousFrameAddress = 0;
}
default: default:
return false; return false;