sl@0: // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of the License "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // some utility classes for writing data to buffer sl@0: // sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @internalTechnology sl@0: */ sl@0: #ifndef __CRASH_LOG_WALKER_H_INCLUDED__ sl@0: #define __CRASH_LOG_WALKER_H_INCLUDED__ sl@0: sl@0: #include sl@0: #include sl@0: sl@0: #include sl@0: sl@0: namespace Debug sl@0: { sl@0: sl@0: /** sl@0: * This class provides functionality to walk through a crash log in a data buffer sl@0: * ensuring it is valid and getting the information we require back sl@0: */ sl@0: class TCrashLogWalker sl@0: { sl@0: public: sl@0: TCrashLogWalker(TDesC8& aBuffer); sl@0: sl@0: TInt ReadLogHeader(const TInt aStartPoint); sl@0: TInt GetCrashSize() const; sl@0: TInt GetCrashId() const; sl@0: const TRmdArmExcInfo& GetCrashContext() const; sl@0: const TCrashInfoHeader& GetCrashHeader() const; sl@0: const TCrashOffsetsHeader& GetOffsetsHeader() const; sl@0: sl@0: #ifndef __KERNEL_MODE__ sl@0: MByteStreamSerializable* GetNextDataTypeL(TInt& aPos, SCMStructId& aId, TInt& aBufferSize); sl@0: TRawData* GetRawDataTypeL(TInt& aPos, TInt& aBufferSize, TDes8& aRawBuf, TInt aStartRawPosition = 0); sl@0: #endif sl@0: sl@0: void UpdateBuffer(TDesC8& aBuffer); sl@0: sl@0: private: sl@0: sl@0: void HelpAssignRegisterToContext(const TRegisterValue& aRegVal); sl@0: sl@0: private: sl@0: TDesC8& iBuffer; //buffer containing data for the log we are walking - not all of it, just the bit of interest sl@0: TCrashInfoHeader iCrashHeader; //Stores the header of the log we are walking sl@0: TCrashOffsetsHeader iOffsets; //Stores the offsets header of the log we are walking sl@0: TRmdArmExcInfo iContext; //Stores the register context of the log we are walking sl@0: sl@0: TByteStreamReader iReader; sl@0: sl@0: private: sl@0: TInt VerifyHeader(); sl@0: sl@0: }; sl@0: sl@0: } sl@0: sl@0: #endif // __CRASH_LOG_WALKER_H_INCLUDED__