Esempio n. 1
0
 /// <summary>
 /// Creates a code unit object.
 /// </summary>
 /// <param name="Offset">The size in bytes of the code source.</param>
 /// <param name="Name">The offset within the object file at which the source is present.</param>
 /// <param name="Lines">The source's code.</param>
 public CodeUnit(uint Offset, String Name, CodeLine[] Lines)
 {
     this.Offset = Offset;
     this.Name   = Name;
     this.Lines  = Lines;
     this.Size   = this.Lines.Sum(line => line.Size);
 }
Esempio n. 2
0
        /// <summary>
        /// Creates a code unit object.
        /// </summary>
        /// <param name="offset">The size in bytes of the code unit.</param>
        /// <param name="name">The offset within the object file at which the unit is present.</param>
        /// <param name="symbol">The symbol by which the unit is referred.</param>
        /// <param name="path">The path to the source file which defines this unit.</param>
        /// <param name="lines">The unit's code.</param>
        public CodeUnit(long offset, String name, String symbol, String path, CodeLine[] lines)
        {
            this.Offset = offset;
            this.Name   = name;
            this.Symbol = symbol;
            this.Lines  = lines;
            this.Size   = this.Lines.Sum(line => (long)line.Size);

            this.SourceFilepath = Utils.GetPlatformPath(path);
        }
Esempio n. 3
0
        public CodeLineItem(CodeLine line, bool showAssembly = true)
        {
            this.InitializeComponent();
            this.address = line.Offset;
            this.length  = line.Size;
            this.code    = line;

            this.ShowAssembly = showAssembly;

            // Update the text
            this.codeText.Text = line.Text;

            for (int i = 0; i < line.Assembly.Length; i++)
            {
                this.AddItem(new AssemblyLineItem(line.Assembly[i]));
            }
        }
Esempio n. 4
0
 public void AddCodeLine(CodeLine line)
 {
     this.lines.Add(line);
 }