Exemplo n.º 1
0
 // Once you have a file path to a PDB file, you can open it with this method
 /// <summary>
 /// Given the path name to a particular PDB file, load it so that you can resolve symbols in it.  
 /// </summary>
 /// <param name="symbolFilePath">The name of the PDB file to open.</param>
 /// <returns>The SymbolReaderModule that represents the information in the symbol file (PDB)</returns>
 public SymbolModule OpenSymbolFile(string symbolFilePath)
 {
     Debug.Assert(!IsDisposed);
     var ret = new SymbolModule(this, symbolFilePath);
     return ret;
 }
Exemplo n.º 2
0
        internal unsafe SourceFile(SymbolModule module, IDiaSourceFile sourceFile)
        {
            m_symbolModule = module;
            BuildTimeFilePath = sourceFile.fileName;

            // 0 No checksum present.
            // 1 CALG_MD5 checksum generated with the MD5 hashing algorithm.
            // 2 CALG_SHA1 checksum generated with the SHA1 hashing algorithm.
            m_hashType = sourceFile.checksumType;
            if (m_hashType != 1 && m_hashType != 0)
            {
                // TODO does anyone use SHA1?
                Debug.Assert(false, "Unknown hash type");
                m_hashType = 0;
            }
            if (m_hashType != 0)
            {
                // MD5 is 16 bytes
                // SHA1 is 20 bytes
                m_hash = new byte[16];

                uint bytesFetched;
                fixed (byte* bufferPtr = m_hash)
                    sourceFile.get_checksum((uint)m_hash.Length, out bytesFetched, out *bufferPtr);
                Debug.Assert(bytesFetched == 16);
            }
        }