Ejemplo n.º 1
0
        public void LoadSymbolsForModule(Module module)
        {
            Contract.Requires(module != null);
            Contract.Requires(module.Name != null);

            if (NativeMethods.IsUnix())
            {
                return;
            }

            var moduleName = module.Name.ToLower();

            bool createNew;

            lock (symbolReaders)
            {
                createNew = !symbolReaders.ContainsKey(moduleName);
            }

            if (createNew)
            {
                var reader = SymbolReader.FromModule(module, SymbolSearchPath);

                lock (symbolReaders)
                {
                    symbolReaders[moduleName] = reader;
                }
            }
        }
Ejemplo n.º 2
0
        public void TryResolveSymbolsForModule(RemoteProcess.Module module)
        {
            Contract.Requires(module != null);

            var name = module.Name.ToLower();

            bool isBlacklisted;

            lock (symbolReaders)
            {
                isBlacklisted = moduleBlacklist.Contains(name);
            }

            if (!isBlacklisted)
            {
                try
                {
                    SymbolReader.TryResolveSymbolsForModule(module, SymbolSearchPath);
                }
                catch
                {
                    lock (symbolReaders)
                    {
                        moduleBlacklist.Add(name);

                        File.WriteAllLines(
                            Path.Combine(SymbolCachePath, BlackListFile),
                            moduleBlacklist.ToArray()
                            );
                    }
                }
            }
        }
Ejemplo n.º 3
0
        public void LoadSymbolsFromPDB(string path)
        {
            Contract.Requires(path != null);

            if (NativeMethods.IsUnix())
            {
                return;
            }

            var moduleName = Path.GetFileName(path)?.ToLower();

            if (string.IsNullOrEmpty(moduleName))
            {
                return;
            }

            bool createNew;

            lock (symbolReaders)
            {
                createNew = !symbolReaders.ContainsKey(moduleName);
            }

            if (createNew)
            {
                var reader = SymbolReader.FromDatabase(path);

                lock (symbolReaders)
                {
                    symbolReaders[moduleName] = reader;
                }
            }
        }
Ejemplo n.º 4
0
        public static SymbolReader FromDatabase(string path)
        {
            Contract.Requires(path != null);

            var reader = new SymbolReader();

            reader.diaSource.Interface.loadDataFromPdb(path);
            reader.CreateSession();
            return(reader);
        }
Ejemplo n.º 5
0
        public static SymbolReader FromModule(Module module, string searchPath)
        {
            Contract.Requires(module != null);

            var reader = new SymbolReader();

            reader.diaSource.Interface.loadDataForExe(module.Path, searchPath, null);
            reader.CreateSession();
            return(reader);
        }
Ejemplo n.º 6
0
        public void LoadSymbolsFromPDB(string path)
        {
            Contract.Requires(path != null);

            var moduleName = Path.GetFileName(path).ToLower();

            bool createNew;

            lock (symbolReaders)
            {
                createNew = !symbolReaders.ContainsKey(moduleName);
            }

            if (createNew)
            {
                var reader = SymbolReader.FromDatabase(path);

                lock (symbolReaders)
                {
                    symbolReaders[moduleName] = reader;
                }
            }
        }
Ejemplo n.º 7
0
        public void LoadSymbolsForModule(RemoteProcess.Module module)
        {
            Contract.Requires(module != null);

            var moduleName = module.Name.ToLower();

            bool createNew;

            lock (symbolReaders)
            {
                createNew = !symbolReaders.ContainsKey(moduleName);
            }

            if (createNew)
            {
                var reader = SymbolReader.FromModule(module, SymbolSearchPath);

                lock (symbolReaders)
                {
                    symbolReaders[moduleName] = reader;
                }
            }
        }