private static Scope ReadPDBScope(PDBScope scope, MergeBuffer mergeBuffer, [CanBeNull] Scope parent, MethodDef thisMeth) { Contract.Requires(scope != null); Contract.Requires(thisMeth != null); Scope thisScope = new Scope(parent, thisMeth); if (parent != null) { mergeBuffer.Add(new OpenScope(thisScope), (uint)scope.StartOffset); } foreach (PDBVariable var in scope.Variables) { thisScope.AddLocalBinding(var.Name, var.Address); } foreach (PDBScope child in scope.Children) { ReadPDBScope(child, mergeBuffer, thisScope, thisMeth); } if (parent != null) { mergeBuffer.Add(new CloseScope(thisScope), (uint)scope.EndOffset); } return(thisScope); }