Пример #1
0
 private void ParseSymbols(string aLine)
 {
     try
     {
         // It's the start of a section...
         Match m = KSectionRegEx.Match(aLine);
         if (m.Success)
         {
             iSectionType        = GetSection(aLine);
             iLastSeenObjectName = string.Empty;
         }
         else if (iSectionType != TSection.ESectionUnsupported)
         {
             m = KSizeAndObjectRegEx.Match(aLine);
             if (m.Success)
             {
                 iLastSeenObjectName = m.Groups["Object"].Value.Trim();
             }
             else
             {
                 Symbol sym = iSymbolParser.Parse(aLine);
                 if (sym != null)
                 {
                     // Update object with cached information
                     sym.Object = iLastSeenObjectName;
                     iUnsortedSymbols.Add(sym);
                 }
             }
         }
     }
     catch (Exception)
     {
     }
 }
Пример #2
0
        private static TSection GetSection(string aText)
        {
            TSection ret = TSection.ESectionUnsupported;
            //
            Match m = KSectionRegEx.Match(aText);

            if (m.Success)
            {
                string sectionName = m.Groups[0].Value;
                switch (sectionName)
                {
                case ".text":
                    ret = TSection.ESectionText;
                    break;

                case ".emb_text":
                    ret = TSection.ESectionEmbText;
                    break;

                case ".rodata":
                    ret = TSection.ESectionReadOnlyData;
                    break;

                default:
                    break;
                }
            }
            //
            return(ret);
        }