|
1 // Copyright (c) 2008-2009 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 #include <rm_debug_api.h> |
|
27 |
|
28 #include <scmdatatypes.h> |
|
29 |
|
30 namespace Debug |
|
31 { |
|
32 |
|
33 /** |
|
34 * This class provides functionality to walk through a crash log in a data buffer |
|
35 * ensuring it is valid and getting the information we require back |
|
36 */ |
|
37 class TCrashLogWalker |
|
38 { |
|
39 public: |
|
40 TCrashLogWalker(TDesC8& aBuffer); |
|
41 |
|
42 TInt ReadLogHeader(const TInt aStartPoint); |
|
43 TInt GetCrashSize() const; |
|
44 TInt GetCrashId() const; |
|
45 const TRmdArmExcInfo& GetCrashContext() const; |
|
46 const TCrashInfoHeader& GetCrashHeader() const; |
|
47 const TCrashOffsetsHeader& GetOffsetsHeader() const; |
|
48 |
|
49 #ifndef __KERNEL_MODE__ |
|
50 MByteStreamSerializable* GetNextDataTypeL(TInt& aPos, SCMStructId& aId, TInt& aBufferSize); |
|
51 TRawData* GetRawDataTypeL(TInt& aPos, TInt& aBufferSize, TDes8& aRawBuf, TInt aStartRawPosition = 0); |
|
52 #endif |
|
53 |
|
54 void UpdateBuffer(TDesC8& aBuffer); |
|
55 |
|
56 private: |
|
57 |
|
58 void HelpAssignRegisterToContext(const TRegisterValue& aRegVal); |
|
59 |
|
60 private: |
|
61 TDesC8& iBuffer; //buffer containing data for the log we are walking - not all of it, just the bit of interest |
|
62 TCrashInfoHeader iCrashHeader; //Stores the header of the log we are walking |
|
63 TCrashOffsetsHeader iOffsets; //Stores the offsets header of the log we are walking |
|
64 TRmdArmExcInfo iContext; //Stores the register context of the log we are walking |
|
65 |
|
66 TByteStreamReader iReader; |
|
67 |
|
68 private: |
|
69 TInt VerifyHeader(); |
|
70 |
|
71 }; |
|
72 |
|
73 } |
|
74 |
|
75 #endif // __CRASH_LOG_WALKER_H_INCLUDED__ |