CloseMethod() public method

public CloseMethod ( ) : void
return void
Esempio n. 1
0
        public void Write(MethodBody body, /*Telerik Authorship*/ MetadataToken methodToken, /*Telerik Authorship*/ MetadataToken localVarToken)
        {
            /*Telerik Authorship*/
            //var method_token = body.Method.MetadataToken;
            var sym_token = new SymbolToken(methodToken.ToInt32());
            //var sym_token = new SymbolToken(body.Method.MetadataToken.ToInt32());

            var instructions = CollectInstructions(body);

            if (instructions.Count == 0)
            {
                return;
            }

            var start_offset = 0;
            var end_offset   = body.CodeSize;

            writer.OpenMethod(sym_token);
            writer.OpenScope(start_offset);

            DefineSequencePoints(instructions);

            /*Telerik Authorship*/
            Dictionary <VariableDefinition, string> methodVariableDefinitionToNameMap =
                GetMethodVariableDefinitionToNameMap(body.Method);

            DefineVariables(body, /*Telerik Authorship*/ localVarToken, /*Telerik Authorship*/ methodVariableDefinitionToNameMap, start_offset, end_offset);

            writer.CloseScope(end_offset);
            writer.CloseMethod();
        }
Esempio n. 2
0
        public void Write(MethodBody body)
        {
            var method_token = body.Method.MetadataToken;
            var sym_token    = new SymbolToken(method_token.ToInt32());

            var instructions = CollectInstructions(body);

            if (instructions.Count == 0)
            {
                return;
            }

            var start_offset = 0;
            var end_offset   = body.CodeSize;

            writer.OpenMethod(sym_token);
            writer.OpenScope(start_offset);

            DefineSequencePoints(instructions);
            DefineVariables(body, start_offset, end_offset);

            writer.CloseScope(end_offset);

            if (body.IteratorType != null)
            {
                DefineIteratorType(sym_token, body.IteratorType.Name);
            }

            if (body.iterator_scopes != null)
            {
                DefineIteratorScopes(sym_token, body.IteratorScopes, body.CodeSize);
            }

            writer.CloseMethod();
        }
Esempio n. 3
0
        public void Write(MethodDebugInformation info)
        {
            var method_token = info.method.MetadataToken;
            var sym_token    = method_token.ToInt32();

            if (!info.HasSequencePoints && info.scope == null && !info.HasCustomDebugInformations && info.StateMachineKickOffMethod == null)
            {
                return;
            }

            writer.OpenMethod(sym_token);

            if (!info.sequence_points.IsNullOrEmpty())
            {
                DefineSequencePoints(info.sequence_points);
            }

            var import_parent = new MetadataToken();

            if (info.scope != null)
            {
                DefineScope(info.scope, info, out import_parent);
            }

            DefineCustomMetadata(info, import_parent);

            writer.CloseMethod();
        }
Esempio n. 4
0
 public void Write(MethodBody body)
 {
     CreateDocuments(body);
     m_writer.OpenMethod(new SymbolToken((int)body.Method.MetadataToken.ToUInt()));
     CreateScopes(body, body.Scopes, new SymbolToken(body.LocalVarToken));
     m_writer.CloseMethod();
 }
Esempio n. 5
0
        public void Write(MethodBody body)
        {
            var method_token = body.Method.MetadataToken;
            var sym_token    = new SymbolToken(method_token.ToInt32());

            var instructions = CollectInstructions(body);

            if (instructions.Count == 0 && !body.HasVariables)
            {
                return;
            }

            var pdbSymbols = body.Symbols as PdbMethodSymbols;

            writer.OpenMethod(sym_token);

            DefineSequencePoints(instructions);

            if (body.Scope != null)
            {
                WriteScope(body, body.Scope, true);
            }
            else
            {
                writer.OpenScope(0);
                DefineUsedNamespaces(pdbSymbols);
                if (body.HasVariables)
                {
                    DefineVariables(body, body.Variables, 0, body.CodeSize);
                }
                writer.CloseScope(body.CodeSize);
            }

            DefineCustomMetadata(pdbSymbols);

            writer.CloseMethod();
        }
Esempio n. 6
0
        public void Write(MethodDebugInformation info)
        {
            var method_token = info.method.MetadataToken;
            var sym_token    = new SymbolToken(method_token.ToInt32());

            writer.OpenMethod(sym_token);

            DefineSequencePoints(info.sequence_points);

            if (info.scope != null)
            {
                DefineScope(info.scope, info);
            }

            writer.CloseMethod();
        }