crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Structures/Common/ExitInfo.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 
       
    23 namespace CrashDebuggerLib.Structures.Common
       
    24 {
       
    25     public class ExitInfo
       
    26     {
       
    27         #region Enumerations
       
    28         public enum TExitType
       
    29         {
       
    30             /**
       
    31             The thread or process has ended as a result of a kill,
       
    32             i.e. Kill() has been called on the RThread or RProcess handle.
       
    33             Or a thread was ended as a result of calling User::Exit().
       
    34             */
       
    35             EExitKill,
       
    36 
       
    37             /**
       
    38             The thread or process has ended as a result of a terminate,
       
    39             i.e. Terminate() has been called on the RThread or RProcess handle.
       
    40             */
       
    41             EExitTerminate,
       
    42 
       
    43             /**
       
    44             The thread or process has been panicked.
       
    45             */
       
    46             EExitPanic,
       
    47 
       
    48             /**
       
    49             The thread or process is alive.
       
    50             */
       
    51             EExitPending
       
    52         }
       
    53         #endregion
       
    54 
       
    55         #region Constructors
       
    56         public ExitInfo()
       
    57         {
       
    58         }
       
    59         #endregion
       
    60 
       
    61         #region API
       
    62         #endregion
       
    63 
       
    64         #region Properties
       
    65         public TExitType Type
       
    66         {
       
    67             get { return iType; }
       
    68             set { iType = value; }
       
    69         }
       
    70 
       
    71         public string Category
       
    72         {
       
    73             get { return iCategory; }
       
    74             set { iCategory = value; }
       
    75         }
       
    76 
       
    77         public int Reason
       
    78         {
       
    79             get { return iReason; }
       
    80             set { iReason = value; }
       
    81         }
       
    82         #endregion
       
    83 
       
    84         #region Internal methods
       
    85         #endregion
       
    86 
       
    87         #region Internal constants
       
    88         #endregion
       
    89 
       
    90         #region From System.Object
       
    91         public override string ToString()
       
    92         {
       
    93             StringBuilder ret = new StringBuilder();
       
    94             //
       
    95             if ( Type == TExitType.EExitPending )
       
    96             {
       
    97                 ret.Append( "[Pending]" );
       
    98             }
       
    99             else
       
   100             {
       
   101                 switch ( Type )
       
   102                 {
       
   103                     case TExitType.EExitKill:
       
   104                         ret.Append( "[Kill]" );
       
   105                         break;
       
   106                     case TExitType.EExitPanic:
       
   107                         ret.Append( "[Panic]" );
       
   108                         break;
       
   109                     case TExitType.EExitTerminate:
       
   110                         ret.Append( "[Terminate]" );
       
   111                         break;
       
   112                 }
       
   113 
       
   114                 ret.AppendFormat( " {0}-{1}", Category, Reason );
       
   115             }
       
   116             //
       
   117             return ret.ToString();
       
   118         }
       
   119         #endregion
       
   120 
       
   121         #region Data members
       
   122         private TExitType iType = TExitType.EExitPending;
       
   123         private int iReason = 0;
       
   124         private string iCategory = string.Empty;
       
   125         #endregion
       
   126     }
       
   127 }