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); }
private void CreateSession() { Contract.Ensures(diaSession != null); diaSource.Interface.openSession(out var session); diaSession = new ComDisposableWrapper <IDiaSession>(session); }
private void CreateSession() { IDiaSession session; diaSource.Interface.openSession(out session); diaSession = new ComDisposableWrapper <IDiaSession>(session); }
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); } }
protected virtual void Dispose(bool disposing) { if (diaSource != null) { diaSource.Dispose(); diaSource = null; if (diaSession != null) { diaSession.Dispose(); diaSession = null; } } }
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); }
public SymbolReader() { diaSource = new ComDisposableWrapper <DiaSource>(new DiaSource()); }
public SymbolReader(string searchPath) { diaSource = new ComDisposableWrapper <DiaSource>(new DiaSource()); this.searchPath = searchPath; }