os/kernelhwsrv/kernel/eka/debug/crashMonitor/inc/crashlogwalker.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kernel/eka/debug/crashMonitor/inc/crashlogwalker.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,75 @@
     1.4 +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of the License "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// some utility classes for writing data to buffer
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +/**
    1.22 + @file
    1.23 + @internalTechnology
    1.24 +*/
    1.25 +#ifndef __CRASH_LOG_WALKER_H_INCLUDED__
    1.26 +#define __CRASH_LOG_WALKER_H_INCLUDED__
    1.27 +
    1.28 +#include <e32cmn.h> 
    1.29 +#include <rm_debug_api.h>
    1.30 +
    1.31 +#include <scmdatatypes.h>
    1.32 +
    1.33 +namespace Debug
    1.34 +	{
    1.35 +	
    1.36 +	/**
    1.37 +	 * This class provides functionality to walk through a crash log in a data buffer
    1.38 +	 * ensuring it is valid and getting the information we require back
    1.39 +	 */
    1.40 +	class TCrashLogWalker
    1.41 +		{
    1.42 +	public:
    1.43 +		TCrashLogWalker(TDesC8& aBuffer);
    1.44 +		
    1.45 +		TInt ReadLogHeader(const TInt aStartPoint);		
    1.46 +		TInt GetCrashSize() const;
    1.47 +		TInt GetCrashId() const;
    1.48 +		const TRmdArmExcInfo& GetCrashContext() const;		
    1.49 +		const TCrashInfoHeader& GetCrashHeader() const;
    1.50 +		const TCrashOffsetsHeader& GetOffsetsHeader() const;
    1.51 +		
    1.52 +#ifndef __KERNEL_MODE__		
    1.53 +		MByteStreamSerializable*  GetNextDataTypeL(TInt& aPos, SCMStructId& aId, TInt& aBufferSize);
    1.54 +		TRawData* GetRawDataTypeL(TInt& aPos, TInt& aBufferSize, TDes8& aRawBuf, TInt aStartRawPosition = 0);
    1.55 +#endif
    1.56 +		
    1.57 +		void UpdateBuffer(TDesC8& aBuffer);
    1.58 +		
    1.59 +	private:
    1.60 +		
    1.61 +		void HelpAssignRegisterToContext(const TRegisterValue& aRegVal);
    1.62 +		
    1.63 +	private:
    1.64 +		TDesC8& iBuffer;					//buffer containing data for the log we are walking - not all of it, just the bit of interest
    1.65 +		TCrashInfoHeader iCrashHeader;		//Stores the header of the log we are walking
    1.66 +		TCrashOffsetsHeader iOffsets;		//Stores the offsets header of the log we are walking
    1.67 +		TRmdArmExcInfo iContext;			//Stores the register context of the log we are walking
    1.68 +		
    1.69 +		TByteStreamReader iReader;
    1.70 +		
    1.71 +	private:
    1.72 +		TInt VerifyHeader();
    1.73 +		
    1.74 +		};
    1.75 +	
    1.76 +	}
    1.77 +
    1.78 +#endif // __CRASH_LOG_WALKER_H_INCLUDED__