crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Info/StateInfoScheduler.cs
changeset 0 818e61de6cd1
equal deleted inserted replaced
-1:000000000000 0:818e61de6cd1
       
     1 /*
       
     2 * Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 using System;
       
    19 using System.Collections.Generic;
       
    20 using System.Text;
       
    21 using SymbianParserLib.Engine;
       
    22 using SymbianParserLib.BaseStructures;
       
    23 using CrashDebuggerLib.Structures.Scheduler;
       
    24 using CrashDebuggerLib.Structures.Register;
       
    25 using SymbianParserLib.Elements;
       
    26 using SymbianParserLib.Enums;
       
    27 
       
    28 namespace CrashDebuggerLib.Parsers.State.Implementation
       
    29 {
       
    30     internal class StateInfoScheduler : State
       
    31     {
       
    32         #region Constructors
       
    33         public StateInfoScheduler( CrashDebuggerParser aParser )
       
    34             : base( aParser )
       
    35         {
       
    36         }
       
    37         #endregion
       
    38 
       
    39         #region API
       
    40         public override void Prepare()
       
    41         {
       
    42             PrepareMandatoryParagraph();
       
    43         }
       
    44 
       
    45         public override void Finalise()
       
    46         {
       
    47 
       
    48         }
       
    49         #endregion
       
    50 
       
    51         #region Properties
       
    52         #endregion
       
    53 
       
    54         #region Internal methods
       
    55         private void PrepareMandatoryParagraph()
       
    56         {
       
    57             {
       
    58                 SchedulerInfo info = CrashDebugger.InfoScheduler;
       
    59 
       
    60                 ParserParagraph para = new ParserParagraph( "SCHEDULER_INFO" );
       
    61                 //
       
    62                 ParserLine l1 = ParserLine.NewSymFormat( "SCHEDULER @%08x: CurrentThread %08x\r\n" );
       
    63                 l1.SetTargetProperties( info, "Address", "CurrentNThreadAddress" );
       
    64                 //
       
    65                 ParserLine l2 = ParserLine.NewSymFormat( "RescheduleNeeded=%02x DfcPending=%02x KernCSLocked=%08x\r\n" );
       
    66                 l2.SetTargetProperties( info, "RescheduleNeeded", "DfcPending", "KernCSLocked" ); 
       
    67                 //
       
    68                 ParserLine l3 = ParserLine.NewSymFormat( "DFCS: next %08x prev %08x\r\n" );
       
    69                 l3.SetTargetProperties( info.DFCs, "Next", "Previous" );
       
    70                 //
       
    71                 ParserLine l4 = ParserLine.NewSymFormat( "ProcessHandler=%08x, AddressSpace=%08x\r\n" );
       
    72                 l4.SetTargetProperties( info, "ProcessHandlerAddress", "AddressSpace" );
       
    73                 //
       
    74                 ParserLine l5 = ParserLine.NewSymFormat( "SYSLOCK: HoldingThread %08x iWaiting %08x\r\n" );
       
    75                 l5.SetTargetProperties( info.SysLockInfo, "HoldingThreadAddress", "WaitingThreadAddress" );
       
    76                 //                
       
    77                 ParserLine l6 = ParserLine.NewSymFormat( "Extras 0: %08x 1: %08x 2: %08x 3: %08x\r\n" );
       
    78                 l6.SetTargetMethod( info.ExtraRegisters, "Add" );
       
    79                 //
       
    80                 ParserLine l7 = ParserLine.NewSymFormat( "Extras 4: %08x 5: %08x 6: %08x 7: %08x\r\n" );
       
    81                 l7.SetTargetMethod( info.ExtraRegisters, "Add" );
       
    82                 //
       
    83                 ParserLine l8 = ParserLine.NewSymFormat( "Extras 8: %08x 9: %08x A: %08x B: %08x\r\n" );
       
    84                 l8.SetTargetMethod( info.ExtraRegisters, "Add" );
       
    85                 //
       
    86                 ParserLine l9 = ParserLine.NewSymFormat( "Extras C: %08x D: %08x E: %08x F: %08x\r\n" );
       
    87                 l9.SetTargetMethod( info.ExtraRegisters, "Add" );
       
    88                 //
       
    89                 para.Add( l1, l2, l3, l4, l5, l6, l7, l8, l9 );
       
    90                 ParserEngine.Add( para );
       
    91             }
       
    92         }
       
    93         #endregion
       
    94 
       
    95         #region Data members
       
    96         #endregion
       
    97     }
       
    98 }