| 4585 | } |
| 4586 | |
| 4587 | bool WinDebugger::SetupStep(StepType stepType) |
| 4588 | { |
| 4589 | BP_ZONE("SetupStep"); |
| 4590 | |
| 4591 | RemoveTempBreakpoints(); |
| 4592 | if (mNeedsRehupBreakpoints) |
| 4593 | RehupBreakpoints(true); |
| 4594 | |
| 4595 | if (mOrigStepType == StepType_None) |
| 4596 | mOrigStepType = stepType; |
| 4597 | mStepType = stepType; |
| 4598 | mSteppingThread = mActiveThread; |
| 4599 | mStepSwitchedThreads = false; |
| 4600 | mContinueFromBreakpointFailed = false; |
| 4601 | |
| 4602 | CPURegisters registers; |
| 4603 | PopulateRegisters(®isters); |
| 4604 | addr_target pcAddress = registers.GetPC(); |
| 4605 | |
| 4606 | if (mStepLineData.IsNull()) |
| 4607 | { |
| 4608 | DbgSubprogram* dbgSubprogram = NULL; |
| 4609 | auto dbgLineData = FindLineDataAtAddress(pcAddress, &dbgSubprogram); |
| 4610 | mStepLineData = DbgLineDataEx(dbgLineData, dbgSubprogram); |
| 4611 | mStepStartPC = registers.GetPC(); |
| 4612 | } |
| 4613 | |
| 4614 | bool isDeeper = mStepSP > registers.GetSP(); |
| 4615 | |
| 4616 | BfLogDbg("SetupStep %d PC:%p SP:%p StepStartSP:%p Thread:%d\n", stepType, (addr_target)registers.GetPC(), (addr_target)registers.GetSP(), (addr_target)mStepSP, mSteppingThread->mThreadId); |
| 4617 | |
| 4618 | mStepSP = registers.GetSP(); |
| 4619 | mStepPC = registers.GetPC(); |
| 4620 | |
| 4621 | if ((mStepType == StepType_StepOut) || (mStepType == StepType_StepOut_NoFrame) || (mStepType == StepType_StepOut_ThenInto)) |
| 4622 | { |
| 4623 | if (mStepType != StepType_StepOut_NoFrame) |
| 4624 | { |
| 4625 | // Test for stepping out of an inline method |
| 4626 | DbgSubprogram* dwSubprogram = mDebugTarget->FindSubProgram(pcAddress); |
| 4627 | if ((dwSubprogram != NULL) && (dwSubprogram->mInlineeInfo != NULL)) |
| 4628 | { |
| 4629 | DbgSubprogram* topSubprogram = dwSubprogram->GetRootInlineParent(); |
| 4630 | |
| 4631 | if ((mOrigStepType == StepType_StepInto) || (mOrigStepType == StepType_StepInto_Unfiltered)) |
| 4632 | { |
| 4633 | mStepType = mOrigStepType; |
| 4634 | } |
| 4635 | else |
| 4636 | { |
| 4637 | mStepType = StepType_StepOut_Inline; |
| 4638 | // Set up pcAddress to detect recursion |
| 4639 | //TODO: We can't set a physical breakpoint here because we will immediately hit it when attempting to step over an inlined method. |
| 4640 | // An inlined method can't recurse anyway, but store the pcAddress in mTempBreakpoints because we still check that for recursion |
| 4641 | // SetTempBreakpoint(pcAddress); |
| 4642 | //mTempBreakpoint.push_back(pcAddress); |
| 4643 | mStepBreakpointAddrs.push_back(pcAddress); |
| 4644 | } |
nothing calls this directly
no test coverage detected