crashanalysercmd/Libraries/Engine/CrashDebuggerLib/Parsers/State/Implementation/Info/StateInfoFault.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 CrashDebuggerLib.Structures.Fault;
       
    23 using SymbianParserLib.Elements;
       
    24 using SymbianParserLib.Enums;
       
    25 
       
    26 namespace CrashDebuggerLib.Parsers.State.Implementation
       
    27 {
       
    28     internal class StateInfoFault : State
       
    29     {
       
    30         #region Constructors
       
    31         public StateInfoFault( CrashDebuggerParser aParser )
       
    32             : base( aParser )
       
    33         {
       
    34         }
       
    35         #endregion
       
    36 
       
    37         #region API
       
    38         public override void Prepare()
       
    39         {
       
    40             PrepareMandatoryParagraph();
       
    41             PrepareOptionalParagraph();
       
    42         }
       
    43 
       
    44         public override void Finalise()
       
    45         {
       
    46             
       
    47         }
       
    48         #endregion
       
    49 
       
    50         #region Properties
       
    51         #endregion
       
    52 
       
    53         #region Internal methods
       
    54         private void PrepareMandatoryParagraph()
       
    55         {
       
    56             ParserParagraph para = new ParserParagraph( "FaultInfo");
       
    57             //
       
    58             ParserLine l1 = ParserLine.NewSymFormat( "Fault Category: %S  Fault Reason: %08x\r\n" );
       
    59             l1.SetTargetProperties( CrashDebugger.InfoFault, "Category", "Reason" );
       
    60             //
       
    61             ParserLine l2 = ParserLine.NewSymFormat( "ExcId %08x CodeAddr %08x DataAddr %08x Extra %08x\r\n" );
       
    62             l2.SetTargetProperties( CrashDebugger.InfoFault, "ExceptionId", "CodeAddress", "DataAddress", "ExtraInfo" );
       
    63             //
       
    64             para.Add( l1, l2 );
       
    65             ParserEngine.Add( para );
       
    66         }
       
    67 
       
    68         private void PrepareOptionalParagraph()
       
    69         {
       
    70             ParserParagraph para = new ParserParagraph( "CpuFaultInfo" );
       
    71             para.SetTargetMethod( CrashDebugger.InfoFault.Registers, "Add", TValueStoreMethodArguments.EValueStoreMethodArgumentNameAsString, TValueStoreMethodArguments.EValueStoreMethodArgumentValue );
       
    72             //
       
    73             ParserLine l1 = ParserLine.NewSymFormat( "Exc %1d Cpsr=%08x FAR=%08x FSR=%08x\r\n" );
       
    74             l1[ 0 ].SetTargetProperties( CrashDebugger.InfoFault, "ExcCode" );
       
    75             //
       
    76             ParserLine l2 = ParserLine.NewSymFormat( " R0=%08x  R1=%08x  R2=%08x  R3=%08x\r\n" );
       
    77             ParserLine l3 = ParserLine.NewSymFormat( " R4=%08x  R5=%08x  R6=%08x  R7=%08x\r\n" );
       
    78             ParserLine l4 = ParserLine.NewSymFormat( " R8=%08x  R9=%08x R10=%08x R11=%08x\r\n" );
       
    79             ParserLine l5 = ParserLine.NewSymFormat( "R12=%08x R13=%08x R14=%08x R15=%08x\r\n" );
       
    80             ParserLine l6 = ParserLine.NewSymFormat( "R13Svc=%08x R14Svc=%08x SpsrSvc=%08x\r\n" );
       
    81             //
       
    82             para.Add( l1, l2, l3, l4, l5, l6 );
       
    83             ParserEngine.Add( para );
       
    84         }
       
    85         #endregion
       
    86 
       
    87         #region Data members
       
    88         #endregion
       
    89     }
       
    90 }