Example #1
0
        public static void TryResolveSymbolsForModule(Module module, string searchPath)
        {
            Contract.Requires(module != null);

            using var diaSource = new ComDisposableWrapper <DiaSource>(new DiaSource());
            diaSource.Interface.loadDataForExe(module.Path, searchPath, null);
        }
Example #2
0
        private void CreateSession()
        {
            Contract.Ensures(diaSession != null);

            diaSource.Interface.openSession(out var session);

            diaSession = new ComDisposableWrapper <IDiaSession>(session);
        }
Example #3
0
        private void CreateSession()
        {
            IDiaSession session;

            diaSource.Interface.openSession(out session);

            diaSession = new ComDisposableWrapper <IDiaSession>(session);
        }
Example #4
0
        private void ReadSymbolType(IDiaSymbol symbol, StringBuilder sb)
        {
            Contract.Requires(symbol != null);
            Contract.Requires(sb != null);

            if (symbol.type != null)
            {
                using var type = new ComDisposableWrapper <IDiaSymbol>(symbol.type);

                ReadType(type.Interface, sb);
            }
        }
Example #5
0
        protected virtual void Dispose(bool disposing)
        {
            if (diaSource != null)
            {
                diaSource.Dispose();
                diaSource = null;

                if (diaSession != null)
                {
                    diaSession.Dispose();
                    diaSession = null;
                }
            }
        }
Example #6
0
        public string GetSymbolString(IntPtr address, Module module)
        {
            Contract.Requires(module != null);

            var rva = address.Sub(module.Start);

            diaSession.Interface.findSymbolByRVA((uint)rva.ToInt32(), SymTagEnum.SymTagNull, out var diaSymbol);
            if (diaSymbol != null)
            {
                using var symbol = new ComDisposableWrapper <IDiaSymbol>(diaSymbol);

                var sb = new StringBuilder();
                ReadSymbol(symbol.Interface, sb);
                return(sb.ToString());
            }
            return(null);
        }
Example #7
0
 public SymbolReader()
 {
     diaSource = new ComDisposableWrapper <DiaSource>(new DiaSource());
 }
Example #8
0
        public SymbolReader(string searchPath)
        {
            diaSource = new ComDisposableWrapper <DiaSource>(new DiaSource());

            this.searchPath = searchPath;
        }