Пример #1
0
        void LineComplete(ParserElementBase aElement)
        {
            ParserLine       line      = (ParserLine)aElement;
            TUserContextType tableType = (TUserContextType)line.Tag;
            UserContextTable table     = CrashDebugger.UserContextTableManager[tableType];

            // Each line should have a known number of entries stored within it's field collection.
            int expectedCount = UserContextTable.EntryCount * 2; // 2 fields per table entry
            int actualCount   = line.Count;

            if (expectedCount == actualCount)
            {
                for (int i = 0; i < expectedCount; i += 2)
                {
                    ParserField fieldType  = line[i + 0];
                    ParserField fieldValue = line[i + 1];
                    //
                    if (fieldType.IsUint && fieldValue.IsUint)
                    {
                        UserContextTable.TArmRegisterIndex reg = (UserContextTable.TArmRegisterIndex)(i / 2);
                        UserContextTableEntry entry            = table[reg];
                        //
                        UserContextTableEntry.TType type = (UserContextTableEntry.TType)fieldType.AsUint;
                        byte value = (byte)fieldValue.AsUint;
                        //
                        entry.Type   = type;
                        entry.Offset = value;
                    }
                }
            }
            else
            {
                throw new Exception("User Context Table Corruption");
            }
        }
Пример #2
0
        public override ITable GetTable(ObjectName tableName)
        {
            var table = GetCachedTable(tableName.FullName) as ITable;

            if (table == null)
            {
                table = Session.Access().GetTable(tableName);
                if (table != null)
                {
                    table = new UserContextTable(Request, table);
                    CacheTable(tableName.FullName, table);
                }
            }

            return(table);
        }
Пример #3
0
        public override ITable GetTable(ObjectName tableName)
        {
            var table = GetCachedTable(tableName.FullName) as ITable;
            if (table == null) {
                table = Session.Access().GetTable(tableName);
                if (table != null) {
                    table = new UserContextTable(Request, table);
                    CacheTable(tableName.FullName, table);
                }
            }

            return table;
        }