0
|
1 |
// Copyright (c) 2007-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 "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 |
// Common Crash Data definitions used between the core dump server,
|
|
15 |
// formatters and user interfaces
|
|
16 |
//
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
/**
|
|
21 |
@file
|
|
22 |
@publishedPartner
|
|
23 |
@released
|
|
24 |
@see CCrashDataSource
|
|
25 |
@see RCoreDumpSession
|
|
26 |
*/
|
|
27 |
|
|
28 |
#ifndef CRASH_DATA_H
|
|
29 |
#define CRASH_DATA_H
|
|
30 |
|
|
31 |
#include <e32std.h>
|
|
32 |
#include <e32const.h>
|
|
33 |
#include <rm_debug_api.h>
|
|
34 |
#include <s32strm.h>
|
|
35 |
#include <scmdatatypes.h>
|
|
36 |
|
|
37 |
using namespace Debug;
|
|
38 |
|
|
39 |
/**
|
|
40 |
Crash event information. This is given to a formatter when a crash occurs.
|
|
41 |
@see CCoreDumpFormatter::CrashEventL()
|
|
42 |
*/
|
|
43 |
class TCrashInfo
|
|
44 |
{
|
|
45 |
|
|
46 |
public:
|
|
47 |
/**
|
|
48 |
* Constructs object from stream
|
|
49 |
*/
|
|
50 |
IMPORT_C static TCrashInfo* TCrashInfo::NewL(const TDesC8 & aStreamData);
|
|
51 |
|
|
52 |
/**
|
|
53 |
* Constructs from structure
|
|
54 |
*/
|
|
55 |
IMPORT_C static TCrashInfo* TCrashInfo::NewL(const TCrashInfoHeader& aCrashHeader);
|
|
56 |
|
|
57 |
/**
|
|
58 |
* Initializes ’this’ from stream
|
|
59 |
*/
|
|
60 |
IMPORT_C void InternalizeL(RReadStream & aStream);
|
|
61 |
|
|
62 |
IMPORT_C TCrashInfo();
|
|
63 |
|
|
64 |
IMPORT_C void ExternalizeL(RWriteStream & aStream, CBufFlat* buf);
|
|
65 |
|
|
66 |
IMPORT_C static TInt MaxSize();
|
|
67 |
|
|
68 |
private:
|
|
69 |
|
|
70 |
TCrashInfo(const TCrashInfoHeader& aCrashHeader);
|
|
71 |
void ConstructL(const TCrashInfoHeader& aCrashHeader);
|
|
72 |
|
|
73 |
public:
|
|
74 |
|
|
75 |
/**
|
|
76 |
Type of crash event
|
|
77 |
*/
|
|
78 |
enum TCrashType
|
|
79 |
{
|
|
80 |
/** ECrashException is raised when a hardware exception occurs */
|
|
81 |
ECrashException,
|
|
82 |
|
|
83 |
/** ECrashKill is raised when a thread is killed or panicked */
|
|
84 |
ECrashKill,
|
|
85 |
|
|
86 |
/**
|
|
87 |
@internalTechnology
|
|
88 |
Guard
|
|
89 |
*/
|
|
90 |
ECrashLast
|
|
91 |
};
|
|
92 |
|
|
93 |
/**
|
|
94 |
* Tells us where the crash event came from. ie is it a system crash or a live crash
|
|
95 |
*/
|
|
96 |
enum TCrashSource
|
|
97 |
{
|
|
98 |
ESystemCrash, //!< System Crash - Data in flash
|
|
99 |
ELiveCrash, //!< Live System - Data to be got from DSS
|
|
100 |
|
|
101 |
/**
|
|
102 |
@internalTechnology
|
|
103 |
Guard
|
|
104 |
*/
|
|
105 |
ELast //!< ELast
|
|
106 |
};
|
|
107 |
/** Type of crash
|
|
108 |
@see TCrashType
|
|
109 |
*/
|
|
110 |
TCrashType iType;
|
|
111 |
|
|
112 |
/** Exception type or exit type.
|
|
113 |
If crash type iType is ECrashException, this is set to e32const.h::TExcType
|
|
114 |
If crash type iType is ECrashKill, this is set to e32const.h::TExitType.
|
|
115 |
*/
|
|
116 |
TUint32 iExcNumber;
|
|
117 |
|
|
118 |
/** This is only set when iType is ECrashKill. Kernel panic code. */
|
|
119 |
TInt iReason;
|
|
120 |
|
|
121 |
/** Crash category description. Valid when crash type is ECrashKill */
|
|
122 |
TBuf<KMaxExitCategoryName> iCategory;
|
|
123 |
|
|
124 |
/** Crashed thread id */
|
|
125 |
TUint64 iTid;
|
|
126 |
|
|
127 |
/** Crashed process id */
|
|
128 |
TUint64 iPid;
|
|
129 |
|
|
130 |
/** Crash time */
|
|
131 |
TUint64 iTime;
|
|
132 |
|
|
133 |
/** Register context at time of crash.
|
|
134 |
@see TRmdArmExcInfo
|
|
135 |
@see Debug::TRmdArmExcInfo
|
|
136 |
*/
|
|
137 |
TRmdArmExcInfo iContext;
|
|
138 |
|
|
139 |
/** Id for crash in flash - only relevant for system crash */
|
|
140 |
TUint32 iCrashId;
|
|
141 |
|
|
142 |
/** Externalized size */
|
|
143 |
TUint iSize;
|
|
144 |
|
|
145 |
/** Source of crash
|
|
146 |
* @see TCrashSource
|
|
147 |
*/
|
|
148 |
TCrashSource iCrashSource;
|
|
149 |
|
|
150 |
};
|
|
151 |
|
|
152 |
/**
|
|
153 |
Pointer array of TCodeSegInfo objects.
|
|
154 |
@see TCrashInfo
|
|
155 |
*/
|
|
156 |
typedef RPointerArray<TCrashInfo> RCrashInfoPointerList;
|
|
157 |
|
|
158 |
/**
|
|
159 |
Code segment information.
|
|
160 |
@see CServerCrashDataSource::GetCodeSegmentsL()
|
|
161 |
*/
|
|
162 |
struct TCodeSegInfo
|
|
163 |
{
|
|
164 |
|
|
165 |
/**
|
|
166 |
Name of code segment.
|
|
167 |
*/
|
|
168 |
TBufC<KMaxPath> iName;
|
|
169 |
|
|
170 |
/**
|
|
171 |
Set to trie to indicates that this executable is executing in place.
|
|
172 |
*/
|
|
173 |
TBool iXIP;
|
|
174 |
|
|
175 |
|
|
176 |
/**
|
|
177 |
Type of the code segment.
|
|
178 |
@see Debug::TCodeSegType
|
|
179 |
@see TCodeSegType
|
|
180 |
*/
|
|
181 |
TCodeSegType iType;
|
|
182 |
|
|
183 |
/** Code size in bytes */
|
|
184 |
TUint32 iCodeSize;
|
|
185 |
|
|
186 |
/** Code segment run address. If code segment is XIP then
|
|
187 |
this is the same as iCodeLoadAddr */
|
|
188 |
TLinAddr iCodeRunAddr;
|
|
189 |
|
|
190 |
/** Address where code segement was loaded from */
|
|
191 |
TLinAddr iCodeLoadAddr;
|
|
192 |
|
|
193 |
/** Size on bytes of the read only data */
|
|
194 |
TUint32 iRoDataSize;
|
|
195 |
|
|
196 |
/** Address of read only data at run time. If code segment is XIP then
|
|
197 |
this is the same as iRoDataLoadAddr */
|
|
198 |
TLinAddr iRoDataRunAddr;
|
|
199 |
|
|
200 |
/** Address where read only data was loaded from */
|
|
201 |
TLinAddr iRoDataLoadAddr;
|
|
202 |
|
|
203 |
/** Writable data size in bytes. Combined .bss and .data sections */
|
|
204 |
TUint32 iDataSize;
|
|
205 |
|
|
206 |
/** Address of writable data at run time */
|
|
207 |
TLinAddr iDataRunAddr;
|
|
208 |
|
|
209 |
/** Build time address of initialised writable data */
|
|
210 |
TLinAddr iDataLoadAddr;
|
|
211 |
|
|
212 |
/** reserved for future
|
|
213 |
@internalTechnology */
|
|
214 |
TUint32 iSpare1;
|
|
215 |
/** @internalTechnology */
|
|
216 |
TUint32 iSpare2;
|
|
217 |
/** @internalTechnology */
|
|
218 |
TUint32 iSpare3;
|
|
219 |
};
|
|
220 |
|
|
221 |
/**
|
|
222 |
Pointer array of TCodeSegInfo objects.
|
|
223 |
@see TCodeSegInfo
|
|
224 |
*/
|
|
225 |
typedef RPointerArray<TCodeSegInfo> RCodeSegPointerList;
|
|
226 |
|
|
227 |
|
|
228 |
/**
|
|
229 |
Detailed information about a register.
|
|
230 |
The Symbian ELF format defines the register identification format.
|
|
231 |
The Debug Security Server implements this format.
|
|
232 |
@see CCrashDataSource::ReadRegistersL()
|
|
233 |
*/
|
|
234 |
class TRegisterData
|
|
235 |
{
|
|
236 |
|
|
237 |
public:
|
|
238 |
|
|
239 |
IMPORT_C TUint16 GetId() const;
|
|
240 |
IMPORT_C TUint16 GetSubId() const;
|
|
241 |
IMPORT_C TUint8 GetSize() const;
|
|
242 |
IMPORT_C TUint8 GetClass() const;
|
|
243 |
IMPORT_C TBool SameRegister( const TRegisterData & other ) const;
|
|
244 |
|
|
245 |
IMPORT_C TUint8 GetContent8() const;
|
|
246 |
IMPORT_C TUint16 GetContent16() const;
|
|
247 |
IMPORT_C TUint32 GetContent32() const;
|
|
248 |
IMPORT_C TUint64 GetContent64() const;
|
|
249 |
|
|
250 |
IMPORT_C void SetContent8( const TUint8 aVal );
|
|
251 |
IMPORT_C void SetContent16( const TUint16 aVal );
|
|
252 |
IMPORT_C void SetContent32( const TUint32 aVal );
|
|
253 |
IMPORT_C void SetContent64( const TUint64 aVal );
|
|
254 |
IMPORT_C void SetContent( const TUint aVal );
|
|
255 |
|
|
256 |
IMPORT_C void SetContent( const TRegisterData & other );
|
|
257 |
|
|
258 |
IMPORT_C TBool Available( ) const;
|
|
259 |
IMPORT_C void SetAvailable( const TBool aAvailable );
|
|
260 |
|
|
261 |
|
|
262 |
/**
|
|
263 |
This is the same as symbianelfdefs.h ESYM_REGREP.
|
|
264 |
@see ESYM_REGREP
|
|
265 |
*/
|
|
266 |
typedef enum TRegisterRepresentation
|
|
267 |
{
|
|
268 |
/** 8 Bit register */
|
|
269 |
ERegRepr8 = 0,
|
|
270 |
/** 16 Bit register */
|
|
271 |
ERegRepr16 = 1,
|
|
272 |
/** 32 Bit register */
|
|
273 |
ERegRepr32 = 2,
|
|
274 |
/** 64 Bit register */
|
|
275 |
ERegRepr64 = 3,
|
|
276 |
/**
|
|
277 |
@internalTechnology
|
|
278 |
*/
|
|
279 |
ERegReprLast
|
|
280 |
};
|
|
281 |
|
|
282 |
/**
|
|
283 |
This is the same as symbianelfdefs.h ESYM_REGCLASS.
|
|
284 |
@see ESYM_REGCLASS
|
|
285 |
*/
|
|
286 |
typedef enum TRegisterClass
|
|
287 |
{
|
|
288 |
/** A Core register */
|
|
289 |
ERegClassCore = 0,
|
|
290 |
/** A Co Processor register */
|
|
291 |
ERegClassCoPro = 1,
|
|
292 |
/**
|
|
293 |
@internalTechnology
|
|
294 |
*/
|
|
295 |
ERegClassLast
|
|
296 |
};
|
|
297 |
|
|
298 |
|
|
299 |
/**
|
|
300 |
Register identifier
|
|
301 |
*/
|
|
302 |
union
|
|
303 |
{
|
|
304 |
/** Used when calling the Debug Security Server */
|
|
305 |
TRegisterInfo regInfo;
|
|
306 |
|
|
307 |
/** Same as Sym32_reginfod::rd_id
|
|
308 |
if rid_class == ESYM_REG_CORE
|
|
309 |
rd_id is one of rm_debug_api.h::TFunctionalityRegister
|
|
310 |
else
|
|
311 |
rd_id is CoProcessor number, eg 15 for ARM CP15
|
|
312 |
|
|
313 |
@see Sym32_reginfod::rd_id
|
|
314 |
*/
|
|
315 |
TUint16 iId;
|
|
316 |
};
|
|
317 |
|
|
318 |
/** Same as Sym32_reginfod::rid_class
|
|
319 |
Type of register ESYM_REG_CLASS :{ ESYM_REG_CORE = 0, ESYM_REG_COPRO = 1 }
|
|
320 |
@see Sym32_reginfod::rid_class
|
|
321 |
*/
|
|
322 |
TUint8 iRegClass;
|
|
323 |
|
|
324 |
/** Same as Sym32_reginfod::rd_sub_id
|
|
325 |
Only used if rid_clas == ESYM_REG_COPRO
|
|
326 |
|
|
327 |
Bitfield is made up of the following fields:
|
|
328 |
bits 13 to 11 : OpCode2
|
|
329 |
bits 10 to 8 : OpCode1
|
|
330 |
bits 7 to 4 : CRn
|
|
331 |
bits 3 to 0 : CRm
|
|
332 |
|
|
333 |
@see Sym32_reginfod::rd_sub_id
|
|
334 |
*/
|
|
335 |
TUint16 iSubId;
|
|
336 |
|
|
337 |
/** Same as Sym32_reginfod::rd_repre
|
|
338 |
{ ESYM_REG_8 == 0, ESYM_REG_16 == 1, ESYM_REG_32 == 2, ESYM_REG_64 == 3 }
|
|
339 |
Determines which version of GetContent*() to use
|
|
340 |
@see Sym32_reginfod::rd_repre
|
|
341 |
*/
|
|
342 |
TUint8 iSize;
|
|
343 |
|
|
344 |
|
|
345 |
/** True if the content of this register was succesfully obtained from
|
|
346 |
the target */
|
|
347 |
TBool iAvailable;
|
|
348 |
|
|
349 |
/** Register value */
|
|
350 |
union
|
|
351 |
{
|
|
352 |
/** Value of an 8 bit register */
|
|
353 |
TUint8 iValue8;
|
|
354 |
|
|
355 |
/** Value of a 16 bit register */
|
|
356 |
TUint16 iValue16;
|
|
357 |
|
|
358 |
/** Value of a 32 bit register */
|
|
359 |
TUint32 iValue32;
|
|
360 |
|
|
361 |
/** Value of a 64 bit register */
|
|
362 |
TUint64 iValue64;
|
|
363 |
};
|
|
364 |
|
|
365 |
/** Reserved for future use
|
|
366 |
@internalTechnology */
|
|
367 |
TUint32 iSpare1;
|
|
368 |
|
|
369 |
/** @internalTechnology */
|
|
370 |
TUint32 iSpare2;
|
|
371 |
|
|
372 |
/** @internalTechnology */
|
|
373 |
TUint32 iSpare3;
|
|
374 |
};
|
|
375 |
|
|
376 |
|
|
377 |
/**
|
|
378 |
@publishedPartner
|
|
379 |
@released
|
|
380 |
|
|
381 |
List of TRegisterData objects.
|
|
382 |
@see TRegisterData
|
|
383 |
@see RArray
|
|
384 |
*/
|
|
385 |
typedef RArray<TRegisterData> RRegisterList;
|
|
386 |
|
|
387 |
#endif // CRASH_DATA_H
|
|
388 |
|
|
389 |
|