Esempio n. 1
0
        internal void InitializeMethodBody(ModuleDefMD module, MethodDef ownerMethod, CilBody body, uint methodRid)
        {
            Debug.Assert((module == null) == (ownerMethod == null));
            if (reader == null || body == null)
            {
                return;
            }

            var token = new SymbolToken((int)(0x06000000 + methodRid));
            ISymbolMethod method;

#if THREAD_SAFE
            theLock.EnterWriteLock(); try {
#endif
            method = reader.GetMethod(token);
            if (method != null)
            {
                var pdbMethod = new PdbMethod();
                pdbMethod.Scope = CreateScope(module, ownerMethod == null ? new GenericParamContext() : GenericParamContext.Create(ownerMethod), body, method.RootScope);
                AddSequencePoints(body, method);

                var method2 = method as ISymbolMethod2;
                Debug.Assert(method2 != null);
                if (module != null && method2 != null && method2.IsAsyncMethod)
                {
                    pdbMethod.AsyncMethod = CreateAsyncMethod(module, ownerMethod, body, method2);
                }

                if (ownerMethod != null)
                {
                    // Read the custom debug info last so eg. local names have been initialized
                    var cdiData = reader.GetSymAttribute(token, "MD2");
                    if (cdiData != null && cdiData.Length != 0)
                    {
                        PdbCustomDebugInfoReader.Read(ownerMethod, body, pdbMethod.CustomDebugInfos, cdiData);
                    }
                }

                body.PdbMethod = pdbMethod;
            }
#if THREAD_SAFE
        }

        finally { theLock.ExitWriteLock(); }
#endif
        }
Esempio n. 2
0
        // This one not used by PERWAPI yet.
        public ISymbolMethod GetMethod(SymbolToken tok, int ver)
        {
            // FIXME Contract.Requires(private_reader != null);
            ISymUnmanagedMethod unMeth;
            int hr = private_reader.GetMethodByVersion(tok, ver, out unMeth);

            if (hr == OLE32.hr_E_FAIL) // could be empty method
            {
                return(null);
            }
            else            // any other abnormal HRESULT
            {
                Marshal.ThrowExceptionForHR(hr);
            }
            // All ok ...
            return(new SymbolMethod(unMeth));
        }
Esempio n. 3
0
        public ISymbolMethod GetMethod(SymbolToken method, int version)
        {
            ISymUnmanagedMethod unmanagedMethod = null;
            int hr = m_reader.GetMethodByVersion(method, version, out unmanagedMethod);

            if (hr == (int)HResult.E_FAIL)
            {
                // This means that the method has no symbol info because it's probably empty
                // This can happen for virtual methods with no IL
                return(null);
            }
            else
            {
                Marshal.ThrowExceptionForHR(hr);
            }
            return(new SymMethod(unmanagedMethod));
        }
Esempio n. 4
0
        public ISymbolVariable[] GetVariables(SymbolToken parent)
        {
            int  cVars = 0;
            uint i;

            m_reader.GetVariables(parent, 0, out cVars, null);
            var unmanagedVariables = new ISymUnmanagedVariable[cVars];

            m_reader.GetVariables(parent, cVars, out cVars, unmanagedVariables);
            var variables = new SymVariable[cVars];

            for (i = 0; i < cVars; i++)
            {
                variables[i] = new SymVariable(unmanagedVariables[i]);
            }
            return(variables);
        }
Esempio n. 5
0
        // Write out a reference to the entry point method (if one exists)
        private void WriteEntryPoint(ISymbolReader reader)
        {
            // If there is no entry point token (such as in a dll), this will throw.
            SymbolToken token = reader.UserEntryPoint;

            if (token.GetToken() == 0)
            {
                // If the Symbol APIs fail when looking for an entry point token, there is no entry point.
                return;
            }

            ISymbolMethod m = reader.GetMethod(token);

            xmlWriter.WriteStartElement("entryPoint");
            WriteMethod(m);
            xmlWriter.WriteEndElement();               // </entryPoint>
        }
Esempio n. 6
0
        public ISymbolVariable[] GetLocalVariables(SymbolToken mdMethodToken)
        {
            int count = 0;

            ((ISymUnmanagedEncUpdate)m_reader).GetLocalVariables(mdMethodToken, 0, null, out count);
            ISymUnmanagedVariable[] unmanagedVariables = new ISymUnmanagedVariable[count];
            ((ISymUnmanagedEncUpdate)m_reader).GetLocalVariables(mdMethodToken, count, unmanagedVariables, out count);

            ISymbolVariable[] variables = new ISymbolVariable[count];
            uint i;

            for (i = 0; i < count; i++)
            {
                variables[i] = new SymVariable(unmanagedVariables[i]);
            }
            return(variables);
        }
Esempio n. 7
0
        protected override void OnAnnotation(int annotId)
        {
            if (_readerRoutine == null)
            {
                return;
            }

            var text = _symbolTable.FindKnownSymbol(annotId);

            if (text == null)
            {
                throw new UnknownSymbolException(annotId);
            }
            var token = new SymbolToken(text, annotId);

            _readerRoutine.OnAnnotation(token);
        }
Esempio n. 8
0
        void DefineVariables(MethodSymbols symbols, int start_offset, int end_offset)
        {
            if (!symbols.HasVariables)
            {
                return;
            }

            var sym_token = new SymbolToken(symbols.LocalVarToken.ToInt32());

            var variables = symbols.Variables;

            for (int i = 0; i < variables.Count; i++)
            {
                var variable = variables [i];
                CreateLocalVariable(variable, sym_token, start_offset, end_offset);
            }
        }
Esempio n. 9
0
 public void DefineLocalVariable2(
     string name,
     FieldAttributes attributes,
     SymbolToken sigToken,
     SymAddressKind addrKind,
     int addr1,
     int addr2,
     int addr3,
     int startOffset,
     int endOffset)
 {
     if (name != null)
     {
         m_writer.DefineLocalVariable2(name, (int)attributes, sigToken, (int)addrKind, addr1, addr2, addr3,
                                       startOffset, endOffset);
     }
 }
Esempio n. 10
0
        private void WriteSymbol(string token)
        {
            this.BeginMarker();
            int         sid         = token == null ? 0 : SymbolToken.UnknownSid;
            SymbolToken symbolToken = new SymbolToken(token, sid);

            byte[] scalarBytes = this.GetBytes(IonType.Symbol, symbolToken, false);
            (byte tq, byte[] representation) = this.ScalarOrNullSplitParts(IonType.Symbol, symbolToken, false, scalarBytes);

            this.Update(new byte[] { tq });
            if (representation.Length > 0)
            {
                this.Update(Escape(representation));
            }

            this.EndMarker();
        }
Esempio n. 11
0
        public void Add(SymbolToken symbol, IIonValue value)
        {
            if (symbol.Text != null)
            {
                Add(symbol.Text, value);
                return;
            }

            if (symbol.Sid < 0)
            {
                throw new ArgumentException("symbol has no text or sid", nameof(symbol));
            }
            ThrowIfLocked();
            ThrowIfNull();

            value.FieldNameSymbol = symbol;
            _values.Add(value);
        }
Esempio n. 12
0
        /*******************
         *
         * This is different from CustomAttribute. This is stored into the SymWriter.
         *
         ********************/
        /// <include file='doc\MethodBuilder.uex' path='docs/doc[@for="MethodBuilder.SetSymCustomAttribute"]/*' />
        public void SetSymCustomAttribute(
            String name,                // SymCustomAttribute's name
            byte[]      data)           // the data blob
        {
            m_containingType.ThrowIfCreated();

            ModuleBuilder dynMod = (ModuleBuilder)m_module;

            if (dynMod.GetSymWriter() == null)
            {
                // Cannot SetSymCustomAttribute when it is not a debug module
                throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotADebugModule"));
            }

            SymbolToken tk = new SymbolToken(m_mdMethod.Token);

            dynMod.GetSymWriter().SetSymAttribute(tk, name, data);
        }
Esempio n. 13
0
        byte[] ISymbolReader.GetSymAttribute(SymbolToken parent, string name)
        {
            DbiFunction func;
            bool        b = functions.TryGetValue((uint)parent.GetToken(), out func);

            Debug.Assert(b);
            if (!b)
            {
                return(emptyByteArray);
            }
            var res = func.Root.GetSymAttribute(name);

            if (res == null)
            {
                return(emptyByteArray);
            }
            return(res);
        }
Esempio n. 14
0
        public override string ToString()
        {
            var symbol = SymbolToken.OperatorStringOf(Type);
            var left   = Operand1.ToString();

            if (Operand1.Type.Order() < Type.Order())
            {
                left = $"({left})";
            }

            var right = Operand2.ToString();

            if (Operand2.Type.Order() < Type.Order())
            {
                right = $"({right})";
            }

            return($"{left} {symbol} {right}");
        }
Esempio n. 15
0
        public RuntimeValue GetFieldValue(RuntimeThread thread, SymbolToken token)
        {
            // TODO: static members

            if (!IsObject)
            {
                throw new InvalidOperationException("Value must be an object in order to get values of fields.");
            }

            RuntimeValue value;

            if (!_fieldValues.TryGetValue(token, out value))
            {
                ICorDebugValue comValue;
                ComObjectValue.GetFieldValue(Type.Class.ComClass, (uint)token.GetToken(), out comValue);
                _fieldValues.Add(token, value = new RuntimeValue(Session, comValue));
            }
            return(value);
        }
Esempio n. 16
0
        public void Write(MethodDebugInformation info)
        {
            var method_token = info.method.MetadataToken;
            var sym_token    = new SymbolToken(method_token.ToInt32());

            writer.OpenMethod(sym_token);

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

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

            writer.CloseMethod();
        }
Esempio n. 17
0
        public void AddFormals(SymbolToken newToken, string scope)
        {
            for (int i = 0; i < tempFormals.Count; i++)
            {
                tempFormals[i].Scope = scope;
            }

            table.AddRange(tempFormals);

            if (newToken is Function)
            {
                ((Function)newToken).arguments = new List <Variable>(tempFormals);
            }
            if (newToken is Prototype)
            {
                ((Prototype)newToken).arguments = new List <Variable>(tempFormals);
            }
            tempFormals = new List <Variable>();
        }
        public ISymbolVariable[] GetVariables(SymbolToken parent)
        {
            int varCount;

            HRESULT.ThrowOnFailure(_unmanaged.GetVariables(parent.GetToken(), 0, out varCount, null));

            var unmanagedVars = new ISymUnmanagedVariable[varCount];

            HRESULT.ThrowOnFailure(_unmanaged.GetVariables(parent.GetToken(), unmanagedVars.Length, out varCount, unmanagedVars));

            var variables = new ISymbolVariable[varCount];

            for (int i = 0; i < varCount; i++)
            {
                variables[i] = new SymbolVariable(unmanagedVars[i]);
            }

            return(variables);
        }
        /// <summary>
        /// Try to intern the text of this token to our symbol table.
        /// </summary>
        private SymbolToken InternSymbol(SymbolToken token)
        {
            if (token == default)
            {
                return(token);
            }

            if (token.Text != null)
            {
                return(Intern(token.Text));
            }

            //no text, check if sid is sth we know
            if (token.Sid > SymbolTable.MaxId)
            {
                throw new UnknownSymbolException(token.Sid);
            }

            return(token);
        }
Esempio n. 20
0
        private static int CompareSymbolTokens(SymbolToken tok1, SymbolToken tok2)
        {
            var text1 = tok1.Text;
            var text2 = tok2.Text;

            if (text1 != null && text2 != null)
            {
                return(string.Compare(text1, text2, StringComparison.Ordinal));
            }

            if (text1 != null)
            {
                return(1);
            }
            if (text2 != null)
            {
                return(-1);
            }

            return(tok1.Sid.CompareTo(tok2.Sid));
        }
Esempio n. 21
0
        public override string ToString()
        {
            var symbol = SymbolToken.OperatorStringOf(Type);
            var left   = Operand1.ToString();

            if (Operand1.Type.Order() < Type.Order())
            {
                left = $"({left})";
            }

            var right = Operand2.ToString();

            if (Operand2.Type.Order() < Type.Order())
            {
                right = $"({right})";
            }

            // we reverse here since we want the more complex stuff on the left.
            // our transforms tend to push them to the right, and we can do this
            // since multiplication is commutative.
            return($"{right} {symbol} {left}");
        }
Esempio n. 22
0
        void DefineIteratorScopes(SymbolToken method_token, Collection <InstructionRange> scopes, int code_size)
        {
            var buffer = new PE.ByteBuffer();

            buffer.WriteByte(4);
            buffer.WriteByte(1);
            buffer.Align(4);
            buffer.WriteByte(4);
            buffer.WriteByte(3);
            buffer.Align(4);

            buffer.WriteInt32(scopes.Count * 8 + 12);
            buffer.WriteInt32(scopes.Count);

            foreach (InstructionRange scope in scopes)
            {
                buffer.WriteInt32(scope.Start != null ? scope.Start.Offset : code_size);
                buffer.WriteInt32(scope.End.Next != null ? scope.End.Next.Offset : code_size);
            }

            writer.SetSymAttribute(method_token, "MD2", buffer.length, buffer.buffer);
        }
Esempio n. 23
0
        void DefineIteratorScopes(SymbolToken method_token, Collection <RangeSymbol> scopes)
        {
            var buffer = new PE.ByteBuffer();

            buffer.WriteByte(4);
            buffer.WriteByte(1);
            buffer.Align(4);
            buffer.WriteByte(4);
            buffer.WriteByte(3);
            buffer.Align(4);

            buffer.WriteInt32(scopes.Count * 8 + 12);
            buffer.WriteInt32(scopes.Count);

            foreach (RangeSymbol scope in scopes)
            {
                buffer.WriteInt32(scope.Start);
                buffer.WriteInt32(scope.End);
            }

            writer.SetSymAttribute(method_token, "MD2", buffer.length, buffer.buffer);
        }
Esempio n. 24
0
        // ============================================================================
        // ========================== ISymbolReader Methods ===========================
        // ============================================================================

        /// <summary>
        /// This is the only SymbolReader method required by PERWAPI
        /// at this stage.
        /// </summary>
        /// <param name="tok">The metadata token</param>
        /// <returns>The SymbolMethod object for the token</returns>
        public ISymbolMethod GetMethod(SymbolToken tok)
        {
            // MIDL is ...
            //[PreserveSig]
            //int GetMethod(
            //    SymbolToken methodToken,
            //    [MarshalAs(UnmanagedType.Interface)] out ISymUnmanagedMethod retVal);
            // FIXME Contract.Requires(private_reader != null);
            ISymUnmanagedMethod unMeth;
            int hr = private_reader.GetMethod(tok, out unMeth);

            if (hr == OLE32.hr_E_FAIL) // could be empty method
            {
                return(null);
            }
            else            // any other abnormal HRESULT
            {
                Marshal.ThrowExceptionForHR(hr);
            }
            // All ok ...
            return(new SymbolMethod(unMeth));
        }
Esempio n. 25
0
        private void WriteMethod(Method m)
        {
            SymbolToken methodToken = Util.AsSymToken(m.token);

            m_writer.OpenMethod(methodToken);

            SymbolToken?localSigToken = null;

            if (m.localSigMetadataToken != null)
            {
                localSigToken = new SymbolToken(Util.ToInt32(m.localSigMetadataToken, 16));
            }
            WriteSequencePoints(m.sequencePoints);
            WriteScopesAndLocals(m.rootScope, localSigToken, m);
            WriteSymAttributes(m.symAttributes, methodToken);

            if (m.csharpCDI != null)
            {
                WriteCSharpCDI(m.csharpCDI, methodToken);
            }

            m_writer.CloseMethod();
        }
Esempio n. 26
0
        void DefineVariables(MethodBody body, /*Telerik Authorship*/ MetadataToken localVarToken, /*Telerik Authorship*/ Dictionary <VariableDefinition, string> methodVariableDefinitionToNameMap, int start_offset, int end_offset)
        {
            if (!body.HasVariables)
            {
                return;
            }

            /*Telerik Authorship*/
            //var sym_token = new SymbolToken (body.LocalVarToken.ToInt32 ());
            var sym_token = new SymbolToken(localVarToken.ToInt32());

            var variables = body.Variables;

            for (int i = 0; i < variables.Count; i++)
            {
                var variable = variables [i];

                /*Telerik Authorship*/
                string variableName = GetVariableName(variable, methodVariableDefinitionToNameMap);

                CreateLocalVariable(variable, /*Telerik Authorship*/ variableName, sym_token, start_offset, end_offset);
            }
        }
Esempio n. 27
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. 28
0
        /// <summary>
        /// Initializes a <see cref="CilBody"/> with information found in the PDB file. The
        /// instructions in <paramref name="body"/> must have valid offsets. This method is
        /// automatically called by <see cref="ModuleDefMD"/> and you don't need to explicitly call
        /// it.
        /// </summary>
        /// <param name="body">Method body</param>
        /// <param name="methodRid">Method row ID</param>
        public void InitializeDontCall(CilBody body, uint methodRid)
        {
            if (reader == null || body == null)
            {
                return;
            }
            var token = new SymbolToken((int)(0x06000000 + methodRid));
            ISymbolMethod method;

#if THREAD_SAFE
            theLock.EnterWriteLock(); try {
#endif
            method = reader.GetMethod(token);
            if (method != null)
            {
                body.Scope = CreateScope(body, method.RootScope);
                AddSequencePoints(body, method);
            }
            //TODO: reader.GetSymAttribute()
#if THREAD_SAFE
        }
        finally { theLock.ExitWriteLock(); }
#endif
        }
Esempio n. 29
0
        public override string ToString()
        {
            // In an ideal world we would convert this into subtraction when
            // applicable. This is the lazy way without doing re-tokenization.
            var symbol = SymbolToken.OperatorStringOf(Type);
            var left   = Operand1.ToString();

            if (Operand1.Type.Order() < Type.Order())
            {
                left = $"({left})";
            }

            var right = Operand2.ToString();

            if (Operand2.Type.Order() < Type.Order())
            {
                right = $"({right})";
            }

            // we reverse here since we want the more complex stuff on the left.
            // our transforms tend to push them to the right, and we can do this
            // since multiplication is commutative.
            return($"{right} {symbol} {left}");
        }
Esempio n. 30
0
        /// <summary>
        /// Try to re-make the token in the context of the <paramref name="table"/>.
        /// </summary>
        /// <param name="table">Symbol table</param>
        /// <param name="token">Un-localized token</param>
        /// <returns>Localized token</returns>
        public static SymbolToken Localize(ISymbolTable table, SymbolToken token)
        {
            var newToken = token;

            //try to localize
            if (token.Text == null)
            {
                var text = table.FindKnownSymbol(token.Sid);
                if (text != null)
                {
                    newToken = new SymbolToken(text, token.Sid);
                }
            }
            else
            {
                newToken = table.Find(token.Text);
                if (newToken == default)
                {
                    newToken = new SymbolToken(token.Text, SymbolToken.UnknownSid);
                }
            }

            return(newToken);
        }
Esempio n. 31
0
 public void DefineField(SymbolToken parent, string name, System.Reflection.FieldAttributes attributes, byte[] signature, SymAddressKind addrKind, int addr1, int addr2, int addr3)
 {
     throw new NotImplementedException();
 }
Esempio n. 32
0
        public void DefineField(
			SymbolToken parent,
			string name,
			FieldAttributes attributes,
			byte[] signature,
			SymAddressKind addrKind,
			int addr1,
			int addr2,
			int addr3)
        {
        }
Esempio n. 33
0
 public void OpenMethod(SymbolToken method)
 {
     currentToken = method.GetToken ();
 }
Esempio n. 34
0
 public void SetSymAttribute(SymbolToken parent, string name, byte[] data)
 {
     // This is a hack! but MonoSymbolWriter needs the method name
     // and ISymbolWriter does not have any method for providing it
     if (name == "__name")
         methodName = System.Text.Encoding.UTF8.GetString (data);
 }
 public bool Equals(SymbolToken obj)
 {
 }
Esempio n. 36
0
 public void SetUserEntryPoint(SymbolToken entryMethod)
 {
 }
 public static bool op_Inequality(SymbolToken a, SymbolToken b)
 {
 }
Esempio n. 38
0
		public void OpenMethod(SymbolToken method, MethodBase mb)
		{
			int token = method.GetToken();
			currentMethod = new Method(token);
			methodMap.Add(token, mb);
		}
Esempio n. 39
0
		public void OpenMethod(SymbolToken method)
		{
			throw new NotImplementedException();
		}
Esempio n. 40
0
        private Token TokenizeSymbol()
        {
            int start = _pos;

            while (true)
            {
                this.Advance();
                if (this.IsEnd() || !IsAcceptableSymbolInnerChar(this.GetCurr()))
                {
                    break;
                }
            }

            int end = _pos;

            int len = end - start;
            string word = _text.ToString(start, len);

            Token tok = new SymbolToken(word);

            return tok;
        }
Esempio n. 41
0
        private Token TokenizeNumberOrSymbol()
        {
            int start = _pos;

            bool gotDot = false;
            bool isSymbol = false;

            this.Advance();

            while (true)
            {
                if (IsEnd())
                {
                    break;
                }

                char curr = this.GetCurr();

                if (IsSeparator(curr))
                {
                    break;
                }
                else if (curr == ')')
                {
                    break;
                }
                else if (IsDigit(curr))
                {
                    this.Advance();
                }
                else if (curr == '.')
                {
                    if (gotDot)
                    {
                        throw new NotImplementedException(); // second dot should evaluate to symbol
                    }
                    else
                    {
                        this.Advance();
                        gotDot = true;
                    }
                }
                else if (IsSimpleSymbol(curr))
                {
                    this.Advance();
                    isSymbol = true;
                }
                else if (curr == ',')
                {
                    break;
                }
                else
                {
                    throw new NotImplementedException();
                }
            }

            string str = _text.ToString(start, _pos - start);

            Token tok;

            if (isSymbol)
            {
                tok = new SymbolToken(str);
            }
            else
            {
                tok = new NumberToken(str);
            }

            return tok;
        }
Esempio n. 42
0
 public void SetSymAttribute(SymbolToken parent, string name, byte[] data)
 {
     throw new NotImplementedException();
 }
Esempio n. 43
0
 public void SetUserEntryPoint(SymbolToken entryMethod)
 {
     throw new NotImplementedException();
 }
Esempio n. 44
0
        private void WriteMethod(MethodHandle methodHandle)
        {
            int token = metadataReader.GetToken(methodHandle);
            var symbolToken = new SymbolToken(token);

            byte[] bytes = pdbReader.RawSymbolReader.GetCustomDebugInfo(token);
            ISymbolMethod methodSymbol = pdbReader.SymbolReader.GetMethod(symbolToken);
            if (bytes == null && methodSymbol == null)
            {
                // no debug info for the method
                return;
            }

            writer.WriteStartElement("method");
            WriteMethodAttributes(token, isReference: false);

            if (bytes != null)
            {
                WriteCustomDebugInfo(bytes);
            }

            if (methodSymbol != null)
            {
                WriteSequencePoints(methodSymbol);

                // TODO (tomat): Ideally this would be done in a separate test helper, not in PdbToXml.
                // verify ISymUnmanagedMethod APIs:
                ISymUnmanagedMethod rawMethod = pdbReader.RawSymbolReader.GetBaselineMethod(token);

                var expectedSlotNames = new Dictionary<int, ImmutableArray<string>>();
                WriteLocals(rawMethod, expectedSlotNames);

                var actualSlotNames = rawMethod.GetLocalVariableSlots();

                Debug.Assert(actualSlotNames.Length == (expectedSlotNames.Count == 0 ? 0 : expectedSlotNames.Keys.Max() + 1));

                int i = 0;
                foreach (var slotName in actualSlotNames)
                {
                    if (slotName == null)
                    {
                        Debug.Assert(!expectedSlotNames.ContainsKey(i));
                    }
                    else
                    {
                        Debug.Assert(expectedSlotNames[i].Contains(slotName));
                    }

                    i++;
                }

                ImmutableArray<ISymUnmanagedScope> children = rawMethod.GetRootScope().GetScopes();
                if (children.Length != 0)
                {
                    WriteScopes(children[0]);
                }

                WriteAsyncInfo(methodSymbol as ISymbolAsyncMethod);
            }

            writer.WriteEndElement(); // method
        }
Esempio n. 45
0
 public void OpenMethod(SymbolToken method)
 {
     currentMethod = new Method(method.GetToken());
 }
Esempio n. 46
0
 public bool Equals(SymbolToken obj) => obj._token == _token;