Reads Microsoft program database files created by the .NET compilers.
Inheritance: IDisposable
Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PdbReadType"/> class.
        /// </summary>
        /// <param name="pdbReader">The PDB reader.</param>
        /// <param name="reader">The reader.</param>
        public PdbReadType(PdbReader pdbReader, BinaryReader reader)
            : base(reader)
        {
            if (pdbReader == null)
                throw new ArgumentNullException(@"pdbReader");

            this.pdbReader = pdbReader;
        }
        private static void LoadAssemblyDebugInfo(string assemblyFileName)
        {
            string dbgFile = Path.Combine(Path.GetDirectoryName(assemblyFileName), Path.GetFileNameWithoutExtension(assemblyFileName) + ".pdb");

            if (File.Exists(dbgFile))
            {
                using (FileStream fileStream = new FileStream(dbgFile, FileMode.Open, FileAccess.Read, FileShare.Read))
                {
                    using (PdbReader reader = new PdbReader(fileStream))
                    {
                        Debug.WriteLine(@"Global symbols:");
                        foreach (CvSymbol symbol in reader.GlobalSymbols)
                        {
                            Debug.WriteLine("\t" + symbol.ToString());
                        }

                        Debug.WriteLine(@"Types:");
                        foreach (PdbType type in reader.Types)
                        {
                            Debug.WriteLine("\t" + type.Name);
                            Debug.WriteLine("\t\tSymbols:");
                            foreach (CvSymbol symbol in type.Symbols)
                            {
                                Debug.WriteLine("\t\t\t" + symbol.ToString());
                            }

                            Debug.WriteLine("\t\tLines:");
                            foreach (CvLine line in type.LineNumbers)
                            {
                                Debug.WriteLine("\t\t\t" + line.ToString());
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 3
0
 public CvLineEnumerator(PdbReader reader, int stream, int offset)
 {
     this.reader = reader;
     this.stream = stream;
     this.offset = offset;
 }