Ejemplo n.º 1
0
        private static DebugSymbolInfo readDebugSymbolInfo(BinaryReader rdr)
        {
            var info = new DebugSymbolInfo();

            info.moduleIdx = rdr.ReadUInt32();
            info.name      = readString(rdr);
            info.address   = rdr.ReadUInt32();
            info.type      = rdr.ReadUInt32();

            return(info);
        }
Ejemplo n.º 2
0
        protected override void OnRecache(EventArgs e)
        {
            if (this.DataView == null)
            {
                _lines = null;
                Invalidate();
                return;
            }

            uint numVisLines = this.VisibleSize / this.SizePerLine;

            if (_lines == null || _lines.Length != numVisLines)
            {
                _lines = new lineInfo[numVisLines];
            }

            this.DataView.Seek(this.Address);

            for (uint i = 0; i < _lines.Length; ++i)
            {
                if (this.DataView.Eof)
                {
                    _lines[i] = null;
                    continue;
                }

                ulong curAddress = (ulong)this.Address + (i * this.SizePerLine);

                if (_lines[i] == null)
                {
                    _lines[i] = new lineInfo();
                }

                _lines[i].address = (uint)curAddress;

                string text;
                bool   dataAvail = this.DataView.GetInstruction(out _lines[i].data, out text);
                _lines[i].dataAvailable = dataAvail;
                _lines[i].textAvailable = dataAvail;

                if (dataAvail)
                {
                    string comment   = "";
                    var    spStringX = text.Split(new char[] { ';' }, 2);
                    if (spStringX.Length > 1)
                    {
                        comment = "; " + spStringX[1].Trim();
                    }
                    var spString = spStringX[0].Trim().Split(new char[] { ' ' }, 2);
                    if (spString.Length > 1)
                    {
                        var mne = spString[0];
                        while (mne.Length < 7)
                        {
                            mne = mne + " ";
                        }
                        text = mne + " " + spString[1];
                    }
                    else
                    {
                        text = spString[0];
                    }

                    uint targetAddr = parseAddress(text);
                    if (targetAddr != 0)
                    {
                        DebugSymbolInfo sym = this.DebugManager.FindSymbol(targetAddr);
                        if (sym != null)
                        {
                            var    symMod  = this.DebugManager.GetModule(sym.moduleIdx);
                            string symText = symMod.name + "." + sym.name;
                            comment = symText + " " + comment;
                        }
                    }

                    _lines[i].text    = text;
                    _lines[i].comment = comment;
                }
            }
        }