PrintCompileUnits() public method

public PrintCompileUnits ( ) : void
return void
Esempio n. 1
0
        static int ProcessFile(string filename)
        {
            MonoSymbolFile file;

            Mono.Cecil.AssemblyDefinition asm;

            try {
                asm  = Mono.Cecil.AssemblyDefinition.ReadAssembly(filename);
                file = MonoSymbolFile.ReadSymbolFile(asm.MainModule, filename + ".mdb");
            } catch (Exception ex) {
                Console.WriteLine("Can't read {0}: {1}", filename, ex.Message);
                return(-1);
            }

            MdbSymbolReader reader = new MdbSymbolReader(asm, file);

            try {
                if (ShowSources)
                {
                    reader.PrintSources();
                }
                if (ShowCompileUnits)
                {
                    reader.PrintCompileUnits();
                }
                if (ShowMethods)
                {
                    reader.PrintMethods(false);
                }
                if (ShowLineNumberTables)
                {
                    reader.PrintLineNumberTables();
                }
                if (ShowLocals)
                {
                    reader.PrintMethods(true);
                }
                if (Verify)
                {
                    reader.Read();
                }
            } catch (MonoSymbolFileException ex) {
                Console.WriteLine("Can't read {0}: {1}", filename, ex.Message);
                return(-1);
            } catch (Exception ex) {
                Console.WriteLine("Can't read {0}: {1}", filename, ex);
                return(-1);
            }

            return(0);
        }
Esempio n. 2
0
        static int ProcessFile(string filename)
        {
            MonoSymbolFile file;
            Mono.Cecil.AssemblyDefinition asm;

            try {
                asm = Mono.Cecil.AssemblyFactory.GetAssembly (filename);
                file = MonoSymbolFile.ReadSymbolFile (asm, filename + ".mdb");
            } catch (Exception ex) {
                Console.WriteLine ("Can't read {0}: {1}", filename, ex.Message);
                return -1;
            }

            MdbSymbolReader reader = new MdbSymbolReader (asm, file);

            try {
                if (ShowSources)
                    reader.PrintSources ();
                if (ShowCompileUnits)
                    reader.PrintCompileUnits ();
                if (ShowMethods)
                    reader.PrintMethods (false);
                if (ShowLineNumberTables)
                    reader.PrintLineNumberTables ();
                if (ShowLocals)
                    reader.PrintMethods (true);
                if (Verify)
                    reader.Read ();
            } catch (MonoSymbolFileException ex) {
                Console.WriteLine ("Can't read {0}: {1}", filename, ex.Message);
                return -1;
            } catch (Exception ex) {
                Console.WriteLine ("Can't read {0}: {1}", filename, ex);
                return -1;
            }

            return 0;
        }