Ejemplo n.º 1
0
 /// <inheritdoc/>
 public override void Dump(TextWriter writer)
 {
     writer.Write(Name.ToString());
     writer.Write("; entry point: function #");
     writer.Write(StartFunctionIndex);
     writer.WriteLine();
     if (ExtraPayload.Length > 0)
     {
         writer.Write("Extra payload size: ");
         writer.Write(ExtraPayload.Length);
         writer.WriteLine();
         DumpHelpers.DumpBytes(ExtraPayload, writer);
         writer.WriteLine();
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Writes a textual representation of this exported value to the given writer.
        /// </summary>
        /// <param name="Writer">The writer to which text is written.</param>
        public void Dump(TextWriter Writer)
        {
            Writer.Write("- Memory index: ");
            Writer.Write(MemoryIndex);
            Writer.WriteLine();
            Writer.Write("- Offset:");
            var indentedWriter = DumpHelpers.CreateIndentedTextWriter(Writer);

            foreach (var instruction in Offset.BodyInstructions)
            {
                indentedWriter.WriteLine();
                instruction.Dump(indentedWriter);
            }
            Writer.WriteLine();
            Writer.Write("- Data:");
            indentedWriter.WriteLine();
            DumpHelpers.DumpBytes(Data, indentedWriter);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Writes a textual representation of this function body to the given writer.
        /// </summary>
        /// <param name="Writer">The writer to which text is written.</param>
        public void Dump(TextWriter Writer)
        {
            if (Locals.Count > 0)
            {
                Writer.Write("- Local entries:");
                var varEntryWriter = DumpHelpers.CreateIndentedTextWriter(Writer);
                for (int i = 0; i < Locals.Count; i++)
                {
                    varEntryWriter.WriteLine();
                    varEntryWriter.Write("#{0}: ", i);
                    Locals[i].Dump(varEntryWriter);
                }
                Writer.WriteLine();
            }
            else
            {
                Writer.WriteLine("- No local entries");
            }

            if (BodyInstructions.Count > 0)
            {
                Writer.Write("- Function body:");
                var instructionWriter = DumpHelpers.CreateIndentedTextWriter(Writer);
                foreach (var instr in BodyInstructions)
                {
                    instructionWriter.WriteLine();
                    instr.Dump(instructionWriter);
                }
                Writer.WriteLine();
            }
            else
            {
                Writer.WriteLine("- Empty function body");
            }

            if (HasExtraPayload)
            {
                Writer.Write("- Extra payload size: ");
                Writer.Write(ExtraPayload.Length);
                Writer.WriteLine();
                DumpHelpers.DumpBytes(ExtraPayload, Writer);
                Writer.WriteLine();
            }
        }
Ejemplo n.º 4
0
 /// <inheritdoc/>
 public override void Dump(TextWriter writer)
 {
     writer.Write(Name.ToString());
     writer.Write("; number of entries: ");
     writer.Write(FunctionTypes.Count);
     writer.WriteLine();
     for (int i = 0; i < FunctionTypes.Count; i++)
     {
         writer.Write("#");
         writer.Write(i);
         writer.Write(" -> ");
         FunctionTypes[i].Dump(writer);
         writer.WriteLine();
     }
     if (ExtraPayload.Length > 0)
     {
         writer.Write("Extra payload size: ");
         writer.Write(ExtraPayload.Length);
         writer.WriteLine();
         DumpHelpers.DumpBytes(ExtraPayload, writer);
         writer.WriteLine();
     }
 }
Ejemplo n.º 5
0
 /// <inheritdoc/>
 public override void Dump(TextWriter Writer)
 {
     Writer.Write(Name.ToString());
     Writer.Write("; number of entries: ");
     Writer.Write(Memories.Count);
     Writer.WriteLine();
     for (int i = 0; i < Memories.Count; i++)
     {
         Writer.Write("#");
         Writer.Write(i);
         Writer.Write(" -> ");
         Memories[i].Dump(Writer);
         Writer.WriteLine();
     }
     if (ExtraPayload.Length > 0)
     {
         Writer.Write("Extra payload size: ");
         Writer.Write(ExtraPayload.Length);
         Writer.WriteLine();
         DumpHelpers.DumpBytes(ExtraPayload, Writer);
         Writer.WriteLine();
     }
 }
Ejemplo n.º 6
0
        /// <inheritdoc/>
        public override void Dump(TextWriter Writer)
        {
            Writer.Write(Name.ToString());
            Writer.Write("; number of entries: ");
            Writer.Write(Bodies.Count);
            Writer.WriteLine();
            var indentedWriter = DumpHelpers.CreateIndentedTextWriter(Writer);

            for (int i = 0; i < Bodies.Count; i++)
            {
                Writer.Write("#{0}: ", i);
                indentedWriter.WriteLine();
                Bodies[i].Dump(indentedWriter);
            }
            if (ExtraPayload.Length > 0)
            {
                Writer.Write("Extra payload size: ");
                Writer.Write(ExtraPayload.Length);
                Writer.WriteLine();
                DumpHelpers.DumpBytes(ExtraPayload, Writer);
                Writer.WriteLine();
            }
        }