PrintMethods() public méthode

public PrintMethods ( bool include_locals ) : void
include_locals bool
Résultat void
        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);
        }
Exemple #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;
        }