Example #1
0
        public override void Prepare()
        {
            ParserParagraph para = new ParserParagraph("USERCONTEXTTABLE_INFO");

            // The format of the actual entry specification is the same for each
            // line
            StringBuilder lineFormat = new StringBuilder(  );
            int           count      = UserContextTable.EntryCount;

            for (int i = 0; i < count; i++)
            {
                lineFormat.Append("[%02x, %02x]");
            }

            // Create one line per table
            int tableCount = CrashDebugger.UserContextTableManager.Count;

            for (int i = 0; i < tableCount; i++)
            {
                // Create line based upon dynamic format string
                string     format = String.Format(KTablePrefixFormat, i, lineFormat.ToString());
                ParserLine line   = ParserLine.NewSymFormat(format);

                // Save the context table type - we need this in the callback later on
                line.Tag = (TUserContextType)i;

                // Make sure each field stores it's value internally, so that we can extract it
                // ourselves in the callback.
                line.SetTargetObject();

                // Get a callback when all fields are ready.
                line.ElementComplete += new ParserElementBase.ElementCompleteHandler(LineComplete);

                para.Add(line);
            }

            ParserEngine.Add(para);
        }