internal bool IsLoaded(CodeSegDefinition aDefinition)
        {
            bool ret = iMapFile.HostBinaryFileName == aDefinition.ImageFileNameAndPath;

            return(ret);
        }
 internal void Load(CodeSegDefinition aDefinition)
 {
     iMapFile.Fixup(aDefinition);
 }
Example #3
0
 public virtual bool IsLoaded(CodeSegDefinition aDefinition)
 {
     return(false);
 }
Example #4
0
 public void LoadDynamicCodeSegment(CodeSegDefinition aCodeSegment, TSynchronicity aSynchronicity)
 {
     ROFSEngine.LoadFromDefinition(aCodeSegment, aSynchronicity);
 }
Example #5
0
 public virtual bool LoadFromDefinition(CodeSegDefinition aDefinition, TSynchronicity aSynchronicity)
 {
     throw new NotSupportedException();
 }
Example #6
0
 public virtual bool Unload(CodeSegDefinition aDefinition)
 {
     return(false);
 }
Example #7
0
        public override bool Activate(CodeSegDefinition aCodeSegment)
        {
            bool activated = ActivateAndGetCollection(aCodeSegment) != null;

            return(activated);
        }
Example #8
0
 public abstract SymbolCollection this[CodeSegDefinition aCodeSeg]
 {
     get;
 }
Example #9
0
 public CICodeSeg(CIProcess aProcess, CodeSegDefinition aCodeSegDef)
     : base(aProcess.Container)
 {
     iOwningProcess = aProcess;
     iCodeSegDef    = aCodeSegDef;
 }
Example #10
0
        public override CodeCollection ActivateAndGetCollection(CodeSegDefinition aCodeSegment)
        {
            CodeCollection ret = iRelocator.Activate(aCodeSegment);

            return(ret);
        }
Example #11
0
        private void DoTestHeapCellSymbolLookup()
        {
            CodeSegDefinitionCollection codeSegs = new CodeSegDefinitionCollection();

            using (StringReader reader = new StringReader(KTestBigDsoDataCodeSegList))
            {
                string line = reader.ReadLine();
                while (line != null)
                {
                    CodeSegDefinition def = CodeSegDefinitionParser.ParseDefinition(line);
                    if (def != null)
                    {
                        codeSegs.Add(def);
                    }
                    line = reader.ReadLine();
                }
            }
            codeSegs.SortByAddress();

            using (DbgEngineView view = iDebugEngine.CreateView("TestView", codeSegs))
            {
                foreach (TSymLookupEntry entry in TSymLookupEntry.KHeapSymbols)
                {
                    SymbolCollection col = null;
                    Symbol           sym = view.Symbols.Lookup(entry.iAddress, out col);
                    //
                    if (sym != null)
                    {
                        string name = sym.Name;
                        System.Diagnostics.Debug.Assert(entry.iSymbol == name);
                    }
                    else
                    {
                        System.Diagnostics.Debug.Assert(entry.iSymbol == string.Empty);
                    }
                    //
                    if (col != null)
                    {
                        string name  = entry.iCollection.ToUpper();
                        bool   match = col.FileName.Contains(name);
                        System.Diagnostics.Debug.Assert(match);
                    }
                    else
                    {
                        System.Diagnostics.Debug.Assert(entry.iCollection == string.Empty);
                    }
                    //
                    CodeSegDefinition def = codeSegs[entry.iAddress];
                    if (def != null)
                    {
                        if (entry.iSymbol == string.Empty)
                        {
                            // The original SymbolLib didn't find a symbolic match. It's okay
                            // if we did (or didn't) find a match using SymbianSymbolLib.
                        }
                        else if (entry.iSymbol != string.Empty)
                        {
                            // SymbolLib found a match, SymbianSymbolLib must do too.
                            System.Diagnostics.Debug.Assert(sym != null);
                        }
                        if (col == null)
                        {
                            // We didn't find a symbol collection for the specified address
                            // even though it falls within code segment range. Print a warning
                            // as this may be caused by dodgy symbol file content.
                            System.Diagnostics.Debug.WriteLine(string.Format(@"WARNING: couldn't find symbol for: 0x{0:x8}, offset: 0x{1:x8}, even though code seg match was found: {2}",
                                                                             entry.iAddress,
                                                                             entry.iAddress - def.Base,
                                                                             def));
                        }
                    }
                }
            }
        }
Example #12
0
        protected override void HandleFilteredLine(string aLine)
        {
            const string KHexChars = "abcdefABCDEF1234567890";

            int           startPos = 0;
            StringBuilder line     = new StringBuilder();

            CodeSegDefinition def = iSymbolManager.ROFSEngine.DefinitionParser.ParseAndResolveDefinition(aLine);

            if (def != null)
            {
                SymbolManager.LoadDynamicCodeSegment(def, TSynchronicity.ESynchronous);
                line.Append(aLine);
            }
            else
            {
                // Look through the line looking for 0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f in runs of 8 characters
                MatchCollection collection = iAddressRegEx.Matches(aLine);
                if (collection != null && collection.Count > 0)
                {
                    foreach (Match m in collection)
                    {
                        // Now get the stack address
                        CaptureCollection captures = m.Captures;
                        foreach (Capture capture in captures)
                        {
                            string matchText = capture.Value.Trim();

                            // Take all the initial text
                            int capturePos = capture.Index;

                            // Check whether it is a discrete word
                            bool checkForSymbolMatch = true;
                            if (capturePos > 0)
                            {
                                // Check previous character wasn't a match from our group
                                char prevCharacter = aLine[capturePos - 1];
                                checkForSymbolMatch = (KHexChars.IndexOf(prevCharacter) < 0);
                            }
                            if (checkForSymbolMatch && (capturePos + matchText.Length < aLine.Length))
                            {
                                // Check next character too
                                char nextCharacter = aLine[capturePos + matchText.Length];
                                checkForSymbolMatch = (KHexChars.IndexOf(nextCharacter) < 0);
                            }

                            // Take any preceeding text...
                            if (capturePos > 0)
                            {
                                int length = capturePos - startPos;
                                line.Append(aLine.Substring(startPos, length));
                                startPos = capturePos;
                            }

                            // Always store the original text
                            line.Append(matchText);

                            // Decide if we can try to find a symbol...
                            if (checkForSymbolMatch)
                            {
                                // And now take the text as a symbol (if we have
                                // a match).
                                long address = SymbianUtils.NumberBaseUtils.TextToDecimalNumber(matchText, NumberBaseUtils.TNumberBase.EHex);
                                Generics.GenericSymbol symbol = iSymbolManager.EntryByAddress(address);

                                if (symbol != null)
                                {
                                    line.Append(" [ " + symbol.Symbol + " ]");
                                }
                                else if (iSymbolManager.AddressInRange(address))
                                {
                                    line.Append(" [ #UNKNOWN# ]");
                                }
                            }
                            else
                            {
                                // Not a match, just take the original match text and move on...
                            }

                            startPos += matchText.Length;
                        }
                    }
                }

                // Remember to add anything that is left at the end...
                string remainder = aLine.Substring(startPos);
                line.Append(remainder);
            }

            iWriter.WriteLine(line.ToString());
        }
Example #13
0
 public abstract bool Deactivate(CodeSegDefinition aCodeSegment);
Example #14
0
 internal bool Unload(CodeSegDefinition aDefinition)
 {
     return(true);
 }
Example #15
0
 public override bool Deactivate(CodeSegDefinition aCodeSegment)
 {
     return(iRelocator.Deactivate(aCodeSegment));
 }
Example #16
0
        public override bool IsLoaded(CodeSegDefinition aDefinition)
        {
            bool loaded = iEngineSymbol.IsLoaded(aDefinition);

            return(loaded);
        }
Example #17
0
 public abstract SymbolCollection ActivateAndGetCollection(CodeSegDefinition aCodeSegment);