Beispiel #1
0
        public static void WriteTo(this ReadyToRunMethod theThis, TextWriter writer, DumpOptions options)
        {
            writer.WriteLine(theThis.SignatureString);

            writer.WriteLine($"Handle: 0x{MetadataTokens.GetToken(theThis.ComponentReader.MetadataReader, theThis.MethodHandle):X8}");
            writer.WriteLine($"Rid: {MetadataTokens.GetRowNumber(theThis.ComponentReader.MetadataReader, theThis.MethodHandle)}");
            if (!options.Naked)
            {
                writer.WriteLine($"EntryPointRuntimeFunctionId: {theThis.EntryPointRuntimeFunctionId}");
            }
            writer.WriteLine($"Number of RuntimeFunctions: {theThis.RuntimeFunctions.Count}");
            if (theThis.Fixups != null)
            {
                writer.WriteLine($"Number of fixups: {theThis.Fixups.Count()}");
                IEnumerable <FixupCell> fixups = theThis.Fixups;
                if (options.Normalize)
                {
                    fixups = fixups.OrderBy((fc) => fc.Signature.ToString(options.GetSignatureFormattingOptions()));
                }

                foreach (FixupCell cell in fixups)
                {
                    writer.Write("    ");
                    if (!options.Naked)
                    {
                        writer.Write($"TableIndex {cell.TableIndex}, Offset {cell.CellOffset:X4}: ");
                    }
                    writer.WriteLine(cell.Signature.ToString(options.GetSignatureFormattingOptions()));
                }
            }
        }
Beispiel #2
0
 public static void WriteTo(this ReadyToRunImportSection.ImportSectionEntry theThis, TextWriter writer, DumpOptions options)
 {
     if (!options.Naked)
     {
         writer.Write($"+{theThis.StartOffset:X4}");
         writer.Write($" ({theThis.StartRVA:X4})");
         writer.Write($"  Section: 0x{theThis.Section:X8}");
         writer.Write($"  SignatureRVA: 0x{theThis.SignatureRVA:X8}");
         writer.Write("   ");
     }
     writer.Write(theThis.Signature.ToString(options.GetSignatureFormattingOptions()));
     if (theThis.GCRefMap != null)
     {
         writer.Write(" -- ");
         theThis.GCRefMap.WriteTo(writer);
     }
 }