示例#1
0
        public void SafeReadSymbols(AssemblyDefinition assembly)
        {
            if (!_linkSymbols)
            {
                return;
            }

            if (assembly.MainModule.HasSymbols)
            {
                return;
            }

            try {
                if (_symbolReaderProvider != null)
                {
                    var symbolReader = _symbolReaderProvider.GetSymbolReader(
                        assembly.MainModule,
                        assembly.MainModule.FileName);

                    _annotations.AddSymbolReader(assembly, symbolReader);
                    assembly.MainModule.ReadSymbols(symbolReader);
                }
                else
                {
                    assembly.MainModule.ReadSymbols();
                }
            } catch {}
        }
示例#2
0
        public virtual void SafeReadSymbols(AssemblyDefinition assembly)
        {
            if (assembly.MainModule.HasSymbols)
            {
                return;
            }

            if (_symbolReaderProvider == null)
            {
                throw new ArgumentNullException(nameof(_symbolReaderProvider));
            }

            try {
                var symbolReader = _symbolReaderProvider.GetSymbolReader(
                    assembly.MainModule,
                    assembly.MainModule.FileName);

                if (symbolReader == null)
                {
                    return;
                }

                _annotations.AddSymbolReader(assembly, symbolReader);
                assembly.MainModule.ReadSymbols(symbolReader);
            } catch { }
        }
示例#3
0
        public virtual void SafeReadSymbols(AssemblyDefinition assembly)
        {
            if (assembly.MainModule.HasSymbols)
            {
                return;
            }

            if (_symbolReaderProvider == null)
            {
                throw new ArgumentNullException(nameof(_symbolReaderProvider));
            }

            try {
                var symbolReader = _symbolReaderProvider.GetSymbolReader(
                    assembly.MainModule,
                    assembly.MainModule.FileName);

                if (symbolReader == null)
                {
                    return;
                }

                try {
                    assembly.MainModule.ReadSymbols(symbolReader);
                } catch {
                    symbolReader.Dispose();
                    return;
                }

                // Add symbol reader to annotations only if we have successfully read it
                _annotations.AddSymbolReader(assembly, symbolReader);
            } catch { }
        }
示例#4
0
        public virtual void SafeReadSymbols(AssemblyDefinition assembly)
        {
            if (assembly.MainModule.HasSymbols)
            {
                return;
            }

            if (_symbolReaderProvider == null)
            {
                throw new InvalidOperationException("Symbol provider is not set");
            }

            try {
                var symbolReader = _symbolReaderProvider.GetSymbolReader(
                    assembly.MainModule,
                    GetAssemblyLocation(assembly));

                if (symbolReader == null)
                {
                    return;
                }

                try {
                    assembly.MainModule.ReadSymbols(symbolReader);
                } catch {
                    symbolReader.Dispose();
                    return;
                }

                // Add symbol reader to annotations only if we have successfully read it
                _annotations.AddSymbolReader(assembly, symbolReader);
            } catch { }
        }