예제 #1
0
        public CodeViewTab(ArmAssembly.ArmFileInfo progInfo, ApplicationJimulator jm)
        {
            JM  = jm;
            _PI = progInfo;
            string fileName = progInfo.FileName;

            InitializeComponent();

            this.SuspendLayout();
            this.Location = new System.Drawing.Point(4, 22);
            this.Name     = fileName;
            this.Size     = new System.Drawing.Size(464, 312);
            this.TabIndex = 0;
            this.Text     = Path.GetFileName(fileName);

            _codeViewList                 = new CodeViewList(this);
            _codeViewList.DrawItem       += this.drawItem;
            _codeViewList.VisibleChanged += this.createLines;
            this.Controls.Add(_codeViewList);

            this.fileSystemWatcher1.Path   = Path.GetDirectoryName(fileName);
            this.fileSystemWatcher1.Filter = Path.GetFileName(fileName);
            //_fileChanged = false;
            this.ResumeLayout(false);

            _drawParameters = new DrawParameters(_codeViewList.CreateGraphics(), _codeViewList.Font);
        }
예제 #2
0
        }//LabelToAddress

        /// <summary>
        /// Loads the assembler symbols into the internal tables
        /// Only interested in the code and data section labels.
        /// Store labels as lower case
        /// [Modified by NH so that duplicate keys in the hashtables don't crash]
        /// </summary>
        /// <param name="afi">arm assembler file to load</param>
        public void Load(ArmAssembly.ArmFileInfo armFileInfo)
        {
            //ARMPluginInterfaces.Utils.OutputDebugString("");
            foreach (ArmAssembly.SyEntry se in armFileInfo.LocalSymTable.Values)
            {
                switch (se.Section)
                {
                case ArmAssembly.SectionType.Text:
                    //ARMPluginInterfaces.Utils.OutputDebugString(String.Format(
                    //    "Text: Name:{0} Kind:{1} Line:{2} SubSection:{3}"+
                    //    " Section:{4} Value:0x{5:X}",
                    //    se.Name,se.Kind,se.LineNumber,
                    //    se.SubSection,se.Section,se.Value));

                    if (se.Kind == ArmAssembly.SymbolKind.Label)
                    {
                        _codeLabelsToAddress[se.Name.ToLower()] = (uint)se.SymValue;
                        _lineToLabel[(uint)se.LineNumber]       = se;
                    }    //if
                    break;

                case ArmAssembly.SectionType.Data:
                case ArmAssembly.SectionType.Bss:
                    //ARMPluginInterfaces.Utils.OutputDebugString(String.Format(
                    //    "Data: Name:{0} Kind:{1} Line:{2} SubSection:{3}"+
                    //    " Section:{4} Value:0x{5:X}",
                    //    se.Name,se.Kind,se.LineNumber,
                    //    se.SubSection,se.Section,se.Value));

                    if (se.Kind == ArmAssembly.SymbolKind.Label)
                    {
                        _dataLabelsToAddress[se.Name.ToLower()] = (uint)se.SymValue;
                        _lineToLabel[(uint)se.LineNumber]       = se;
                    }    //if
                    break;

                default: break;
                } //switch
            }     //foreach
        }         //Load
예제 #3
0
 protected ListLine makeResult(string s, uint offsetInFile, string hexcontents,
                               ArmAssembly.SectionType sect, ArmAssembly.ArmFileInfo pi)
 {
     // attempt to eliminate a bug in the mono implementation where tabs do not
     // always seem to be honoured when displaying the line of text
     if (!ARMSim.ARMSimUtil.RunningOnWindows && !String.IsNullOrEmpty(s) && s[0] == '\t')
     {
         s = "        " + s.Substring(1);
     }
     if (offsetInFile == 0xFFFFFFFF)
     {
         if (hexcontents != null)
         {
             return(new ListLine(_drawParameters, s, hexcontents, this));
         }
         return(new ListLine(_drawParameters, s, this));
     }
     if (hexcontents != null)
     {
         return(new ListLine(_drawParameters, s, (uint)(offsetInFile + pi.SectionAddress[(int)sect]), hexcontents, this));
     }
     return(new ListLine(_drawParameters, s, (uint)(offsetInFile + pi.SectionAddress[(int)sect]), this));
 }