@@ -34,6 +34,8 @@ private sealed class MetadataProcessor
3434
3535 internal bool VerboseMinimize { get ; set ; }
3636
37+ public bool DumpMetadata { get ; internal set ; } = false ;
38+
3739 public void Parse ( string fileName )
3840 {
3941 try
@@ -71,6 +73,14 @@ public void Compile(
7173 {
7274 _assemblyBuilder . Write ( writer ) ;
7375 }
76+
77+ if ( DumpMetadata )
78+ {
79+ nanoDumperGenerator dumper = new nanoDumperGenerator (
80+ _assemblyBuilder . TablesContext ,
81+ Path . ChangeExtension ( fileName , "dump.txt" ) ) ;
82+ dumper . DumpAll ( ) ;
83+ }
7484 }
7585 catch ( Exception )
7686 {
@@ -99,6 +109,14 @@ public void Minimize(
99109 {
100110 _assemblyBuilder . Write ( writer ) ;
101111 }
112+
113+ if ( DumpMetadata )
114+ {
115+ nanoDumperGenerator dumper = new nanoDumperGenerator (
116+ _assemblyBuilder . TablesContext ,
117+ Path . ChangeExtension ( fileName , "dump.txt" ) ) ;
118+ dumper . DumpAll ( ) ;
119+ }
102120 }
103121 catch ( Exception ex )
104122 {
@@ -217,6 +235,7 @@ public static void Main(string[] args)
217235 System . Console . WriteLine ( "-minimize Minimizes the assembly, removing unwanted elements." ) ;
218236 System . Console . WriteLine ( "-verbose Outputs each command before executing it." ) ;
219237 System . Console . WriteLine ( "-verboseMinimize Turns on verbose level for the minimization phase." ) ;
238+ System . Console . WriteLine ( "-dump_all Generates a report of an assembly's metadata." ) ;
220239 System . Console . WriteLine ( "" ) ;
221240 }
222241 else if ( arg == "-parse" && i + 1 < args . Length )
@@ -288,6 +307,10 @@ public static void Main(string[] args)
288307 {
289308 md . GenerateDependency ( args [ ++ i ] ) ;
290309 }
310+ else if ( arg == "-dump_all" && i + 1 < args . Length )
311+ {
312+ md . DumpMetadata = true ;
313+ }
291314 else
292315 {
293316 System . Console . Error . WriteLine ( "Unknown command line option '{0}' ignored." , arg ) ;
0 commit comments