Esempio n. 1
0
        private void drawNormalLineCell(Graphics formGraphics, uint address, Point startPoint, int cellNo, ARMPluginInterfaces.MemorySize ms, SolidBrush textBrush)
        {
            Brush  drawBrush = get_changed(address, ms) ? new SolidBrush(_highlightColor) : textBrush;
            string dataChars;

            if (_JM.InRange(address, ARMPluginInterfaces.MemorySize.Byte))
            {
                uint data = this.GetMemory(address, ms);
                dataChars = MemoryToString(data, ms);
            }
            else
            {
                dataChars = MemoryToUnknownString(ms);
            }

            int xpos = startPoint.X + (cellNo * CellWidth(ms));

            for (int kk = 0; kk < dataChars.Length; kk++, xpos += mCharSize.Width)
            {
                formGraphics.DrawString(dataChars.Substring(kk, 1), CurrentFont, drawBrush, xpos, startPoint.Y);
            } //for kk
            if (drawBrush != textBrush)
            {
                drawBrush.Dispose();
            }
        }
Esempio n. 2
0
        public void updateView()
        {
            if (_JM == null || !_JM.ValidLoadedProgram)
            {
                return;
            }
            if (!_JM.InRange(_JM.GPR.PC, ARMPluginInterfaces.MemorySize.Word))
            {
                return;
            }
            if (_errors)
            {
                return;
            }

            foreach (CodeViewTab tab in tabControl1.TabPages)
            {
                if (tab.HasAddress(_JM.GPR.PC))
                {
                    tabControl1.SelectedTab = tab;
                    tab.SelectCodeAddress(_JM.GPR.PC);
                    break;  // no need to continue searching
                }
            }//foreach
        }//updateView
Esempio n. 3
0
        private void panel1_Paint(object sender, PaintEventArgs e)
        {
            if (mJM == null || !mJM.ValidLoadedProgram || mStackWords == null)
            {
                return;
            }

            Graphics g = e.Graphics;

            using (Brush myBrush = new SolidBrush(panel1.ForeColor))
            {
                for (int ii = 0; ii < mStackWords.Length; ii++)
                {
                    //uint word = mStackWords[ii];
                    int       ypos   = ii * panel1.Font.Height;
                    Rectangle bounds = new Rectangle(0, ypos, panel1.ClientRectangle.Width, panel1.Font.Height);
                    if ((mLowAddress + ii) == mStackPointer)
                    {
                        using (SolidBrush b = new SolidBrush(_highlightColor))
                            g.FillRectangle(b, bounds);
                    }
                    else
                    {
                        using (SolidBrush b = new SolidBrush(panel1.BackColor))
                            g.FillRectangle(b, bounds);
                    }

                    uint   address  = (uint)((mLowAddress + ii) << 2);
                    string myString = address.ToString("X8") + ":";
                    if (mJM.InRange(address, ARMPluginInterfaces.MemorySize.Word))
                    {
                        uint opcode = mJM.GetMemoryNoSideEffect(address, ARMPluginInterfaces.MemorySize.Word);
                        myString += opcode.ToString("X8");
                    }
                    else
                    {
                        myString += new string('?', 8);
                    }
                    g.DrawString(myString, panel1.Font, myBrush, bounds);
                }//for ii
            }
        }