crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Fault/FaultInfo.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 
       
    25 namespace CrashDebuggerLib.Structures.Fault
       
    26 {
       
    27     public class FaultInfo : CrashDebuggerAware
       
    28     {
       
    29         #region Enumerations
       
    30         public enum TFaultType
       
    31         {
       
    32             EFaultPanic = 0,
       
    33             EFaultException
       
    34         }
       
    35         #endregion
       
    36 
       
    37         #region Constructors
       
    38         public FaultInfo( CrashDebuggerInfo aCrashDebugger )
       
    39             : base( aCrashDebugger )
       
    40         {
       
    41             iRegisters = new RegisterCollection( aCrashDebugger, RegisterCollection.TType.ETypeGeneral );
       
    42         }
       
    43         #endregion
       
    44 
       
    45         #region API
       
    46         public void Clear()
       
    47         {
       
    48             iCategory = string.Empty;
       
    49             iReason = 0;
       
    50             iCodeAddress = 0;
       
    51             iDataAddress = 0;
       
    52             iExceptionId = 0;
       
    53             iExtraInfo = 0;
       
    54             iExcCode = 0;
       
    55             iRegisters.Clear();
       
    56         }
       
    57         #endregion
       
    58 
       
    59         #region Properties
       
    60         public string Category
       
    61         {
       
    62             get { return iCategory; }
       
    63             set { iCategory = value; }
       
    64         }
       
    65 
       
    66         public uint Reason
       
    67         {
       
    68             get { return iReason; }
       
    69             set { iReason = value; }
       
    70         }
       
    71 
       
    72         public uint CodeAddress
       
    73         {
       
    74             get { return iCodeAddress; }
       
    75             set { iCodeAddress = value; }
       
    76         }
       
    77 
       
    78         public uint DataAddress
       
    79         {
       
    80             get { return iDataAddress; }
       
    81             set { iDataAddress = value; }
       
    82         }
       
    83 
       
    84         public int ExcCode
       
    85         {
       
    86             get { return iExcCode; }
       
    87             set { iExcCode = value; }
       
    88         }
       
    89 
       
    90         public uint ExceptionId
       
    91         {
       
    92             get { return iExceptionId; }
       
    93             set { iExceptionId = value; }
       
    94         }
       
    95 
       
    96         public uint ExtraInfo
       
    97         {
       
    98             get { return iExtraInfo; }
       
    99             set { iExtraInfo = value; }
       
   100         }
       
   101 
       
   102         public RegisterCollection Registers
       
   103         {
       
   104             get { return iRegisters; }
       
   105         }
       
   106 
       
   107         public TFaultType FaultType
       
   108         {
       
   109             get
       
   110             {
       
   111                 TFaultType ret = TFaultType.EFaultPanic;
       
   112                 //
       
   113                 if ( Category == KExceptionFaultReason )
       
   114                 {
       
   115                     ret = TFaultType.EFaultException;
       
   116                 }
       
   117                 //
       
   118                 return ret;
       
   119             }
       
   120         }
       
   121         #endregion
       
   122 
       
   123         #region Internal methods
       
   124         #endregion
       
   125 
       
   126         #region Internal constants
       
   127         private const string KExceptionFaultReason = "Exception";
       
   128         #endregion
       
   129 
       
   130         #region From System.Object
       
   131         public override string ToString()
       
   132         {
       
   133             return base.ToString();
       
   134         }
       
   135         #endregion
       
   136 
       
   137         #region Data members
       
   138         private string iCategory = string.Empty;
       
   139         private uint iReason = 0;
       
   140         private uint iCodeAddress = 0;
       
   141         private uint iDataAddress = 0;
       
   142         private uint iExceptionId = 0;
       
   143         private uint iExtraInfo = 0;
       
   144         private int iExcCode = 0;
       
   145         private readonly RegisterCollection iRegisters;
       
   146         #endregion
       
   147     }
       
   148 }