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
+7 -1
View File
@@ -576,7 +576,13 @@ ThreadHandler::_HandleBreakpointHitStep(CpuState* cpuState)
// 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();
bool hasExitedFrame = fDebuggerInterface->GetArchitecture()
->StackGrowthDirection() == STACK_GROWTH_DIRECTION_POSITIVE
? framePointer < fPreviousFrameAddress
: framePointer > fPreviousFrameAddress;
if (!hasExitedFrame) {
status_t error = _InstallTemporaryBreakpoint( status_t error = _InstallTemporaryBreakpoint(
cpuState->InstructionPointer()); cpuState->InstructionPointer());
if (error != B_OK) if (error != B_OK)