/// <summary> /// Creates a new <see cref="ISymbolReader"/> instance /// </summary> /// <param name="pdbImpl">PDB implementation to use</param> /// <param name="mdStream">.NET metadata stream which is now owned by us. Only need to be /// non-null if MS COM API should be used</param> /// <param name="pdbStream">PDB file stream which is now owned by us</param> /// <returns>A new <see cref="ISymbolReader"/> instance or <c>null</c> if it's not possible /// to create a <see cref="ISymbolReader"/>.</returns> public static ISymbolReader Create(PdbImplType pdbImpl, IImageStream mdStream, IImageStream pdbStream) { switch (pdbImpl) { case PdbImplType.MicrosoftCOM: return(Dss.SymbolReaderCreator.Create(mdStream, pdbStream)); case PdbImplType.Managed: if (mdStream != null) { mdStream.Dispose(); } return(Managed.SymbolReaderCreator.Create(pdbStream)); default: if (mdStream != null) { mdStream.Dispose(); } if (pdbStream != null) { pdbStream.Dispose(); } throw new InvalidOperationException(); } }
/// <summary> /// Creates a new <see cref="ISymbolReader"/> instance /// </summary> /// <param name="pdbImpl">PDB implementation to use</param> /// <param name="metaData">.NET metadata. Only need to be non-null if MS COM API should be used</param> /// <param name="pdbData">PDB file data</param> /// <returns>A new <see cref="ISymbolReader"/> instance or <c>null</c> if it's not possible /// to create a <see cref="ISymbolReader"/>.</returns> public static ISymbolReader Create(PdbImplType pdbImpl, IMetaData metaData, byte[] pdbData) { switch (pdbImpl) { case PdbImplType.MicrosoftCOM: return Dss.SymbolReaderCreator.Create(metaData, pdbData); case PdbImplType.Managed: return Managed.SymbolReaderCreator.Create(pdbData); default: throw new InvalidOperationException(); } }
/// <summary> /// Creates a new <see cref="ISymbolReader"/> instance /// </summary> /// <param name="pdbImpl">PDB implementation to use</param> /// <param name="assemblyFileName">Path to assembly</param> /// <returns>A new <see cref="ISymbolReader"/> instance or <c>null</c> if there's no PDB /// file on disk or if it's not possible to create a <see cref="ISymbolReader"/>.</returns> public static ISymbolReader Create(PdbImplType pdbImpl, string assemblyFileName) { switch (pdbImpl) { case PdbImplType.MicrosoftCOM: return Dss.SymbolReaderCreator.Create(assemblyFileName); case PdbImplType.Managed: return Managed.SymbolReaderCreator.CreateFromAssemblyFile(assemblyFileName); default: throw new InvalidOperationException(); } }
/// <summary> /// Creates a new <see cref="ISymbolReader"/> instance /// </summary> /// <param name="pdbImpl">PDB implementation to use</param> /// <param name="metaData">.NET metadata. Only need to be non-null if MS COM API should be used</param> /// <param name="pdbData">PDB file data</param> /// <returns>A new <see cref="ISymbolReader"/> instance or <c>null</c> if it's not possible /// to create a <see cref="ISymbolReader"/>.</returns> public static ISymbolReader Create(PdbImplType pdbImpl, IMetaData metaData, byte[] pdbData) { switch (pdbImpl) { case PdbImplType.MicrosoftCOM: return(Dss.SymbolReaderCreator.Create(metaData, pdbData)); case PdbImplType.Managed: return(Managed.SymbolReaderCreator.Create(pdbData)); default: throw new InvalidOperationException(); } }
/// <summary> /// Creates a new <see cref="ISymbolReader"/> instance /// </summary> /// <param name="pdbImpl">PDB implementation to use</param> /// <param name="assemblyFileName">Path to assembly</param> /// <returns>A new <see cref="ISymbolReader"/> instance or <c>null</c> if there's no PDB /// file on disk or if it's not possible to create a <see cref="ISymbolReader"/>.</returns> public static ISymbolReader Create(PdbImplType pdbImpl, string assemblyFileName) { switch (pdbImpl) { case PdbImplType.MicrosoftCOM: return(Dss.SymbolReaderCreator.Create(assemblyFileName)); case PdbImplType.Managed: return(Managed.SymbolReaderCreator.CreateFromAssemblyFile(assemblyFileName)); default: throw new InvalidOperationException(); } }
/// <summary> /// Creates a new <see cref="ISymbolReader"/> instance /// </summary> /// <param name="pdbImpl">PDB implementation to use</param> /// <param name="metaData">.NET metadata. Only need to be non-null if MS COM API should be used</param> /// <param name="pdbStream">PDB file stream which is now owned by us</param> /// <returns>A new <see cref="ISymbolReader"/> instance or <c>null</c> if it's not possible /// to create a <see cref="ISymbolReader"/>.</returns> public static ISymbolReader Create(PdbImplType pdbImpl, IMetaData metaData, IImageStream pdbStream) { switch (pdbImpl) { case PdbImplType.MicrosoftCOM: return Dss.SymbolReaderCreator.Create(metaData, pdbStream); case PdbImplType.Managed: return Managed.SymbolReaderCreator.Create(pdbStream); default: if (pdbStream != null) pdbStream.Dispose(); throw new InvalidOperationException(); } }
internal static SymbolReader Create(PdbImplType pdbImpl, IMetaData metaData) { switch (pdbImpl) { case PdbImplType.MicrosoftCOM: return(null); case PdbImplType.Managed: return(ManagedSymbolReaderCreator.Create(metaData)); default: throw new InvalidOperationException(); } }
/// <summary> /// Loads symbols if a PDB file is available /// </summary> /// <param name="pdbImpl">PDB implementation to use</param> public void LoadPdb(PdbImplType pdbImpl) { var loc = location; if (string.IsNullOrEmpty(loc)) return; LoadPdb(SymbolReaderCreator.Create(pdbImpl, loc)); }
/// <summary> /// Loads symbols from a stream /// </summary> /// <param name="pdbImpl">PDB implementation to use</param> /// <param name="pdbStream">PDB file stream which is now owned by us</param> public void LoadPdb(PdbImplType pdbImpl, IImageStream pdbStream) { LoadPdb(SymbolReaderCreator.Create(pdbImpl, metaData, pdbStream)); }
/// <summary> /// Loads symbols from a byte array /// </summary> /// <param name="pdbImpl">PDB implementation to use</param> /// <param name="pdbData">PDB data</param> public void LoadPdb(PdbImplType pdbImpl, byte[] pdbData) { LoadPdb(SymbolReaderCreator.Create(pdbImpl, metaData, pdbData)); }
/// <summary> /// Loads symbols from a PDB file /// </summary> /// <param name="pdbImpl">PDB implementation to use</param> /// <param name="pdbFileName">PDB file name</param> public void LoadPdb(PdbImplType pdbImpl, string pdbFileName) { LoadPdb(SymbolReaderCreator.Create(pdbImpl, metaData, pdbFileName)); }
/// <summary> /// Creates a new <see cref="ISymbolReader"/> instance /// </summary> /// <param name="pdbImpl">PDB implementation to use</param> /// <param name="mdStream">.NET metadata stream which is now owned by us. Only need to be /// non-null if MS COM API should be used</param> /// <param name="pdbData">PDB file data</param> /// <returns>A new <see cref="ISymbolReader"/> instance or <c>null</c> if it's not possible /// to create a <see cref="ISymbolReader"/>.</returns> public static ISymbolReader Create(PdbImplType pdbImpl, IImageStream mdStream, byte[] pdbData) { switch (pdbImpl) { case PdbImplType.MicrosoftCOM: return Dss.SymbolReaderCreator.Create(mdStream, pdbData); case PdbImplType.Managed: if (mdStream != null) mdStream.Dispose(); return Managed.SymbolReaderCreator.Create(pdbData); default: if (mdStream != null) mdStream.Dispose(); throw new InvalidOperationException(); } }