crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Scheduler/SchedulerInfo.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 CrashDebuggerLib.Structures.KernelObjects;
       
    22 using CrashDebuggerLib.Structures.Register;
       
    23 using CrashDebuggerLib.Structures.Common;
       
    24 using CrashDebuggerLib.Structures.NThread;
       
    25 using CrashDebuggerLib.Structures.Thread;
       
    26 
       
    27 namespace CrashDebuggerLib.Structures.Scheduler
       
    28 {
       
    29     public class SchedulerInfo : CrashDebuggerAware
       
    30     {
       
    31         #region Constructors
       
    32         public SchedulerInfo( CrashDebuggerInfo aCrashDebugger )
       
    33             : base( aCrashDebugger )
       
    34         {
       
    35             iExtraRegisters = new RegisterCollection( aCrashDebugger, RegisterCollection.TType.ETypeGeneral );
       
    36         }
       
    37         #endregion
       
    38 
       
    39         #region API
       
    40         public void Clear()
       
    41         {
       
    42             iAddress = 0;
       
    43             iCurrentNThreadAddress = 0;
       
    44             iRescheduleNeeded = 0;
       
    45             iDfcPending = 0;
       
    46             iKernCSLocked = 0;
       
    47             iDFCs = new LinkedListInfo();
       
    48             iProcessHandlerAddress = 0;
       
    49             iAddressSpace = 0;
       
    50             iSysLockInfo = new SchedulerSysLockInfo();
       
    51             iExtraRegisters.Clear();
       
    52         }
       
    53         #endregion
       
    54 
       
    55         #region Properties
       
    56         public uint Address
       
    57         {
       
    58             get { return iAddress; }
       
    59             set { iAddress = value; }
       
    60         }
       
    61 
       
    62         public uint CurrentNThreadAddress
       
    63         {
       
    64             get { return iCurrentNThreadAddress; }
       
    65             set { iCurrentNThreadAddress = value; }
       
    66         }
       
    67 
       
    68         public NThread.NThread CurrentNThread
       
    69         {
       
    70             get
       
    71             {
       
    72                 NThread.NThread ret = null;
       
    73                 //
       
    74                 DObjectCon threads = CrashDebugger.ContainerByType( DObject.TObjectType.EThread );
       
    75                 foreach ( DObject obj in threads )
       
    76                 {
       
    77                     DThread thread = (DThread) obj;
       
    78                     NThread.NThread nThread = thread.NThread;
       
    79                     if ( nThread.Address == CurrentNThreadAddress )
       
    80                     {
       
    81                         ret = nThread;
       
    82                         break;
       
    83                     }
       
    84                 }
       
    85                 //
       
    86                 return ret;
       
    87             }
       
    88         }
       
    89 
       
    90         public uint RescheduleNeeded
       
    91         {
       
    92             get { return iRescheduleNeeded; }
       
    93             set { iRescheduleNeeded = value; }
       
    94         }
       
    95 
       
    96         public uint DfcPending
       
    97         {
       
    98             get { return iDfcPending; }
       
    99             set { iDfcPending = value; }
       
   100         }
       
   101 
       
   102         public uint KernCSLocked
       
   103         {
       
   104             get { return iKernCSLocked; }
       
   105             set { iKernCSLocked = value; }
       
   106         }
       
   107 
       
   108         public LinkedListInfo DFCs
       
   109         {
       
   110             get { return iDFCs; }
       
   111         }
       
   112 
       
   113         public uint ProcessHandlerAddress
       
   114         {
       
   115             get { return iProcessHandlerAddress; }
       
   116             set { iProcessHandlerAddress = value; }
       
   117         }
       
   118 
       
   119         public uint AddressSpace
       
   120         {
       
   121             get { return iAddressSpace; }
       
   122             set { iAddressSpace = value; }
       
   123         }
       
   124 
       
   125         public SchedulerSysLockInfo SysLockInfo
       
   126         {
       
   127             get { return iSysLockInfo; }
       
   128         }
       
   129 
       
   130         public RegisterCollection ExtraRegisters
       
   131         {
       
   132             get { return iExtraRegisters; }
       
   133         }
       
   134         #endregion
       
   135 
       
   136         #region Internal methods
       
   137         #endregion
       
   138 
       
   139         #region Internal constants
       
   140         #endregion
       
   141 
       
   142         #region From System.Object
       
   143         public override string ToString()
       
   144         {
       
   145             return base.ToString();
       
   146         }
       
   147         #endregion
       
   148 
       
   149         #region Data members
       
   150         private uint iAddress;
       
   151         private uint iCurrentNThreadAddress;
       
   152         private uint iRescheduleNeeded;
       
   153         private uint iDfcPending;
       
   154         private uint iKernCSLocked;
       
   155         private LinkedListInfo iDFCs = new LinkedListInfo();
       
   156         private uint iProcessHandlerAddress;
       
   157         private uint iAddressSpace;
       
   158         private SchedulerSysLockInfo iSysLockInfo = new SchedulerSysLockInfo();
       
   159         private readonly RegisterCollection iExtraRegisters;
       
   160         #endregion
       
   161     }
       
   162 }