void StartStepIntoOver(object tag, StepIntoOverData stepIntoOverData) { engine.VerifyMonoDebugThread(); try { stepIntoOverData.StepCounter++; var stepReq = engine.CreateStepRequest(monoThread, e => OnStepIntoOverCompleted(e, tag, stepIntoOverData)); //TODO: StepOver fails on mono unless there's a portable PDB file available stepReq.Depth = stepIntoOverData.IsStepInto ? StepDepth.Into : StepDepth.Over; stepReq.Size = StepSize.Min; stepReq.Filter = GetStepFilterFlags(); stepReq.Enable(); SaveStepper(stepReq, tag, callRunCore: stepIntoOverData.StepCounter == 1); } catch (VMDisconnectedException) { } catch (Exception ex) when(ExceptionUtils.IsInternalDebuggerError(ex)) { RaiseStepComplete(thread, tag, $"Exception: {ex.GetType().FullName}: {ex.Message}"); } }
void GotStepRanges(MDS.StackFrame frame, object tag, bool isStepInto, GetCodeRangeResult result, uint continueCounter) { engine.VerifyMonoDebugThread(); if (IsClosed) { return; } if (stepData != null) { return; } if (continueCounter != engine.ContinueCounter) { RaiseStepComplete(thread, tag, "Internal error"); return; } // If we failed to find the statement ranges (result.Success == false), step anyway. // We'll just step until the next sequence point instead of not doing anything. var stepIntoOverData = new StepIntoOverData(isStepInto, frame.Method, result.StatementRanges); StartStepIntoOver(tag, stepIntoOverData); }
bool OnStepIntoOverCompleted(StepCompleteEventArgs e, object tag, StepIntoOverData stepIntoOverData) { engine.VerifyMonoDebugThread(); if (stepData == null || stepData.MonoStepper != e.StepEventRequest || stepData.Tag != tag) { return(false); } stepData = null; var frame = GetFrame(); uint offset = (uint)(frame?.ILOffset ?? -1); if (!e.ForciblyCanceled && stepIntoOverData.StepCounter < MAX_STEPS && frame?.Method == stepIntoOverData.Method && IsInCodeRange(stepIntoOverData.StatementRanges, offset)) { StartStepIntoOver(tag, stepIntoOverData); return(false); } else { RaiseStepComplete(thread, tag, GetErrorMessage(e), e.ForciblyCanceled); return(true); } }