private static TSymbolType TypeByString(string aTypeAsString)
        {
            TSymbolType ret = TSymbolType.EUnknown;

            //
            if (aTypeAsString == "ARM Code")
            {
                ret = TSymbolType.ECode;
            }
            else if (aTypeAsString == "Thumb Code")
            {
                ret = TSymbolType.ECode;
            }
            else if (aTypeAsString == "Section")
            {
                ret = TSymbolType.ESection;
            }
            else if (aTypeAsString == "Data")
            {
                ret = TSymbolType.EData;
            }
            else if (aTypeAsString == "Number")
            {
                ret = TSymbolType.ENumber;
            }
            //
            return(ret);
        }
        public static bool IsSymbolSerializable(CISymbol aSymbol)
        {
            bool ret = true;

            //
            if (aSymbol.IsNull)
            {
                ret = false;
            }
            else
            {
                TSymbolType type = aSymbol.Symbol.Type;
                ret = (type != TSymbolType.EUnknown);
            }
            return(ret);
        }
        public Symbol Parse(string aLine)
        {
            Symbol ret = null;
            //
            Match m = KMapParserRegex.Match(aLine);

            if (m.Success)
            {
                GroupCollection groups = m.Groups;
                //
                uint   globalBaseAddress = iReader.GlobalBaseAddress;
                string typeString        = groups["Type"].Value;
                //
                string objectName = groups["Binary"].Value;
                uint   size       = uint.Parse(groups["Size"].Value);
                string symbol     = groups["Function"].Value;
                if (symbol.Contains(KExported))
                {
                    symbol = symbol.Substring(0, symbol.LastIndexOf(KExported));
                }
                uint        offsetAddress = uint.Parse(groups["Address"].Value, System.Globalization.NumberStyles.HexNumber) - globalBaseAddress;
                TSymbolType type          = TypeByString(typeString);
                //
                ret = Symbol.New(iCollection);
                ret.OffsetAddress = offsetAddress;
                ret.Size          = size;
                ret.Object        = objectName;
                ret.Name          = symbol;
                ret.Type          = type;

                TSymbolType tt = ret.Type;

                // If the MAP file indicated thumb code then ensure our symbol library agrees.
                if (typeString == "Thumb Code")
                {
                    System.Diagnostics.Debug.Assert(ret.InstructionSet == SymbianStructuresLib.Arm.TArmInstructionSet.ETHUMB);
                }
            }
            //
            return(ret);
        }
Example #4
0
 public bool Equals(TSymbolType other)
 {
     return(IsValid && _symbol.CompareTo(other) == 0);
 }
Example #5
0
 public void Clear()
 {
     _symbol = default(TSymbolType);
     IsValid = false;
 }