crashanalysercmd/PerfToolsSharedLibraries/Engine/SymbianETMLib/Common/Utilities/ETMEnumToTextConverter.cs
changeset 0 818e61de6cd1
equal deleted inserted replaced
-1:000000000000 0:818e61de6cd1
       
     1 /*
       
     2 * Copyright (c) 2009 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 SymbianETMLib.Common.Types;
       
    22 using SymbianStructuresLib.Arm;
       
    23 using SymbianStructuresLib.Arm.Exceptions;
       
    24 
       
    25 namespace SymbianETMLib.Common.Utilities
       
    26 {
       
    27     public static class ETMEnumToTextConverter
       
    28     {
       
    29         public static string ToString( TArmExceptionType aException )
       
    30         {
       
    31             string mode = "???";
       
    32             //
       
    33             switch ( aException )
       
    34             {
       
    35             default:
       
    36             case TArmExceptionType.EUnknown:
       
    37                 break;
       
    38             case TArmExceptionType.ENone:
       
    39                 mode = "Normal";
       
    40                 break;
       
    41             case TArmExceptionType.EHaltingDebug:
       
    42                 mode = "Halting Debug";
       
    43                 break;
       
    44             case TArmExceptionType.ESecureMonitorCall:
       
    45                 mode = "Secure Monitor Call";
       
    46                 break;
       
    47             case TArmExceptionType.EAsyncDataAbort:
       
    48                 mode = "Data Abort";
       
    49                 break;
       
    50             case TArmExceptionType.EJazelle:
       
    51                 mode = "Jazelle";
       
    52                 break;
       
    53             case TArmExceptionType.EProcessorReset:
       
    54                 mode = "Reset";
       
    55                 break;
       
    56             case TArmExceptionType.EUndefinedInstruction:
       
    57                 mode = "Undefined Instruction";
       
    58                 break;
       
    59             case TArmExceptionType.ESVC:
       
    60                 mode = "SVC";
       
    61                 break;
       
    62             case TArmExceptionType.EPrefetchAbortOrSWBreakpoint:
       
    63                 mode = "Prefetch Abort / SW Breakpoint";
       
    64                 break;
       
    65             case TArmExceptionType.ESyncDataAbortOrSWWatchpoint:
       
    66                 mode = "Data Abort / SW Watchbpoint";
       
    67                 break;
       
    68             case TArmExceptionType.EGeneric:
       
    69                 mode = "Generic";
       
    70                 break;
       
    71             case TArmExceptionType.EIRQ:
       
    72                 mode = "IRQ";
       
    73                 break;
       
    74             case TArmExceptionType.EFIQ:
       
    75                 mode = "FIQ";
       
    76                 break;
       
    77             }
       
    78             //
       
    79             return mode;
       
    80         }
       
    81 
       
    82         public static string ToString( TArmInstructionSet aInstructionSet )
       
    83         {
       
    84             string ret = string.Empty;
       
    85             //
       
    86             switch ( aInstructionSet )
       
    87             {
       
    88             case TArmInstructionSet.EARM:
       
    89                 ret = "[A]";
       
    90                 break;
       
    91             case TArmInstructionSet.ETHUMB:
       
    92                 ret = "[T]";
       
    93                 break;
       
    94             case TArmInstructionSet.EJAZELLE:
       
    95                 ret = "[J]";
       
    96                 break;
       
    97             default:
       
    98                 ret = "[?]";
       
    99                 break;
       
   100             }
       
   101             //
       
   102             return ret;
       
   103         }
       
   104     }
       
   105 }