private static Scope[] ReadScopes(MethodEntry entry, MethodBody body, InstructionMapper mapper)
{
CodeBlockEntry[] blocks = entry.GetCodeBlocks();
Scope[] scopes = new Scope[blocks.Length];
CodeBlockEntry[] array = blocks;
for (int i = 0; i < array.Length; i++)
{
CodeBlockEntry block = array[i];
if (block.BlockType == CodeBlockEntry.Type.Lexical)
{
Scope scope = new Scope();
scope.Start = mapper(block.StartOffset);
scope.End = mapper(block.EndOffset);
scopes[block.Index] = scope;
if (body.Scope == null)
{
body.Scope = scope;
}
if (!MdbReader.AddScope(body.Scope, scope))
{
body.Scope = scope;
}
}
}
return(scopes);
}