public void WasBreakpointWithIdHit(string caller_trace, string bpName, string id) { var bp = (LineBreakpoint)ControlInfo.Breakpoints[bpName]; Func <MIOutOfBandRecord, bool> filter = (record) => { if (!IsStoppedEvent(record)) { return(false); } var output = ((MIAsyncRecord)record).Output; var reason = (MIConst)output["reason"]; if (reason.CString != "breakpoint-hit") { return(false); } var frame = (MITuple)output["frame"]; var bkptno = (MIConst)output["bkptno"]; var fileName = (MIConst)frame["file"]; var line = ((MIConst)frame["line"]).Int; if (fileName.CString == bp.FileName && bkptno.CString == id && line == bp.NumLine) { return(true); } return(false); }; Assert.True(MIDebugger.IsEventReceived(filter), @"__FILE__:__LINE__" + "\n" + caller_trace); }
public static void WasBreakpointHit(Breakpoint breakpoint) { var bp = (LineBreakpoint)breakpoint; Func <MIOutOfBandRecord, bool> filter = (record) => { if (!IsStoppedEvent(record)) { return(false); } var output = ((MIAsyncRecord)record).Output; var reason = (MIConst)output["reason"]; if (reason.CString != "breakpoint-hit") { return(false); } var frame = (MITuple)(output["frame"]); var fileName = (MIConst)(frame["file"]); var numLine = (MIConst)(frame["line"]); if (fileName.CString == bp.FileName && numLine.CString == bp.NumLine.ToString()) { return(true); } return(false); }; if (!MIDebugger.IsEventReceived(filter)) { throw new NetcoreDbgTestCore.ResultNotSuccessException(); } }
public static void WasStep(string stepName) { var bp = (LineBreakpoint)DebuggeeInfo.Breakpoints[stepName]; Func <MIOutOfBandRecord, bool> filter = (record) => { if (!IsStoppedEvent(record)) { return(false); } var output = ((MIAsyncRecord)record).Output; var reason = (MIConst)output["reason"]; if (reason.CString != "end-stepping-range") { return(false); } var frame = (MITuple)(output["frame"]); var numLine = (MIConst)(frame["line"]); if (numLine.CString == bp.NumLine.ToString()) { return(true); } return(false); }; if (MIDebugger.IsEventReceived(filter)) { return; } throw new NetcoreDbgTestCore.ResultNotSuccessException(); }