kernel/eka/debug/crashMonitor/inc/crashlogwalker.h
changeset 300 1d28c8722707
parent 293 0659d0e1a03c
child 301 172f33f13d7d
equal deleted inserted replaced
293:0659d0e1a03c 300:1d28c8722707
     1 // Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of the License "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // some utility classes for writing data to buffer
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalTechnology
       
    21 */
       
    22 #ifndef __CRASH_LOG_WALKER_H_INCLUDED__
       
    23 #define __CRASH_LOG_WALKER_H_INCLUDED__
       
    24 
       
    25 #include <e32cmn.h> 
       
    26 
       
    27 #include <scmdatatypes.h>
       
    28 
       
    29 namespace Debug
       
    30 	{
       
    31 	
       
    32 	/**
       
    33 	 * This class provides functionality to walk through a crash log in a data buffer
       
    34 	 * ensuring it is valid and getting the information we require back
       
    35 	 */
       
    36 	class TCrashLogWalker
       
    37 		{
       
    38 	public:
       
    39 		TCrashLogWalker(TDesC8& aBuffer);
       
    40 		
       
    41 		TInt ReadLogHeader(const TInt aStartPoint);		
       
    42 		TInt GetCrashSize() const;
       
    43 		TInt GetCrashId() const;
       
    44 		const TRmdArmExcInfo& GetCrashContext() const;		
       
    45 		const TCrashInfoHeader& GetCrashHeader() const;
       
    46 		const TCrashOffsetsHeader& GetOffsetsHeader() const;
       
    47 		
       
    48 #ifndef __KERNEL_MODE__		
       
    49 		MByteStreamSerializable*  GetNextDataTypeL(TInt& aPos, SCMStructId& aId, TInt& aBufferSize);
       
    50 		TRawData* GetRawDataTypeL(TInt& aPos, TInt& aBufferSize, TDes8& aRawBuf, TInt aStartRawPosition = 0);
       
    51 #endif
       
    52 		
       
    53 		void UpdateBuffer(TDesC8& aBuffer);
       
    54 		
       
    55 	private:
       
    56 		
       
    57 		void HelpAssignRegisterToContext(const TRegisterValue& aRegVal);
       
    58 		
       
    59 	private:
       
    60 		TDesC8& iBuffer;					//buffer containing data for the log we are walking - not all of it, just the bit of interest
       
    61 		TCrashInfoHeader iCrashHeader;		//Stores the header of the log we are walking
       
    62 		TCrashOffsetsHeader iOffsets;		//Stores the offsets header of the log we are walking
       
    63 		TRmdArmExcInfo iContext;			//Stores the register context of the log we are walking
       
    64 		
       
    65 		TByteStreamReader iReader;
       
    66 		
       
    67 	private:
       
    68 		TInt VerifyHeader();
       
    69 		
       
    70 		};
       
    71 	
       
    72 	}
       
    73 
       
    74 #endif // __CRASH_LOG_WALKER_H_INCLUDED__