void WriteAsyncMethodSteppingInformation(PdbAsyncMethodCustomDebugInfo cdi) { if (!methodContext.HasBody) { helper.Error("Method has no body, can't write custom debug info: " + cdi.Kind); return; } uint catchHandlerOffset; if (cdi.CatchHandlerInstruction == null) { catchHandlerOffset = 0; } else { catchHandlerOffset = methodContext.GetOffset(cdi.CatchHandlerInstruction) + 1; } writer.WriteUInt32(catchHandlerOffset); var cdiStepInfos = cdi.StepInfos; int count = cdiStepInfos.Count; for (int i = 0; i < count; i++) { var info = cdiStepInfos[i]; if (info.YieldInstruction == null) { helper.Error("YieldInstruction is null"); return; } if (info.BreakpointMethod == null) { helper.Error("BreakpointMethod is null"); return; } if (info.BreakpointInstruction == null) { helper.Error("BreakpointInstruction is null"); return; } uint yieldOffset = methodContext.GetOffset(info.YieldInstruction); uint resumeOffset; if (methodContext.IsSameMethod(info.BreakpointMethod)) { resumeOffset = methodContext.GetOffset(info.BreakpointInstruction); } else { resumeOffset = GetOffsetSlow(info.BreakpointMethod, info.BreakpointInstruction); } uint resumeMethodRid = systemMetadata.GetRid(info.BreakpointMethod); writer.WriteUInt32(yieldOffset); writer.WriteUInt32(resumeOffset); writer.WriteCompressedUInt32(resumeMethodRid); } }