51
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef MEMSPYDRIVEROBJECTSSHARED_H
|
|
19 |
#define MEMSPYDRIVEROBJECTSSHARED_H
|
|
20 |
|
|
21 |
// System includes
|
|
22 |
#include <u32std.h>
|
|
23 |
|
|
24 |
// User includes
|
|
25 |
#include <memspy/driver/memspydriverenumerationsshared.h>
|
|
26 |
#include <memspy/driver/memspydriverobjectssharedrheap.h>
|
|
27 |
|
|
28 |
// Classes referenced
|
|
29 |
class CActiveScheduler;
|
|
30 |
class CTrapCleanup;
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
/**
|
|
35 |
* ARM user registers.
|
|
36 |
* Size must be multiple of 4 bytes.
|
|
37 |
*/
|
|
38 |
class TMemSpyDriverRegSet
|
|
39 |
{
|
|
40 |
public:
|
|
41 |
enum { KRegCount = 16 };
|
|
42 |
TUint32 iRn[KRegCount];
|
|
43 |
TUint32 iCpsr;
|
|
44 |
};
|
|
45 |
|
|
46 |
|
|
47 |
/**
|
|
48 |
* ARM-specific exception-related data.
|
|
49 |
* Size must be multiple of 4 bytes.
|
|
50 |
*/
|
|
51 |
class TMemSpyDriverCpuExcInfo
|
|
52 |
{
|
|
53 |
public:
|
|
54 |
enum TExcCode
|
|
55 |
{
|
|
56 |
EPrefetchAbort=0,
|
|
57 |
EDataAbort=1,
|
|
58 |
EUndefinedOpcode=2,
|
|
59 |
};
|
|
60 |
public:
|
|
61 |
TExcCode iExcCode;
|
|
62 |
/** Point to instruction which caused exception */
|
|
63 |
TUint32 iFaultPc;
|
|
64 |
/**
|
|
65 |
Address which caused exception (System Control Coprocessor Fault
|
|
66 |
Address Register)
|
|
67 |
*/
|
|
68 |
TUint32 iFaultAddress;
|
|
69 |
/** System Control Coprocessor Fault Status Register */
|
|
70 |
TUint32 iFaultStatus;
|
|
71 |
/** R13 supervisor mode banked register */
|
|
72 |
TUint32 iR13Svc;
|
|
73 |
/** R14 supervisor mode banked register */
|
|
74 |
TUint32 iR14Svc;
|
|
75 |
/** SPSR supervisor mode banked register */
|
|
76 |
TUint32 iSpsrSvc;
|
|
77 |
};
|
|
78 |
|
|
79 |
|
|
80 |
|
|
81 |
|
|
82 |
|
|
83 |
/**
|
|
84 |
* Stack water mark parameters
|
|
85 |
*/
|
|
86 |
struct TMemSpyDriverStackWatermarkParams
|
|
87 |
{
|
|
88 |
TUint8* iStackDataAddress;
|
|
89 |
TInt iStackDataLength;
|
|
90 |
TRequestStatus* iStatus;
|
|
91 |
TLinAddr iUserStackPointer;
|
|
92 |
};
|
|
93 |
|
|
94 |
|
|
95 |
|
|
96 |
|
|
97 |
/**
|
|
98 |
* Stack information block.
|
|
99 |
*/
|
|
100 |
class TMemSpyDriverStackInfo
|
|
101 |
{
|
|
102 |
public:
|
|
103 |
TUint iUserStackPointer;
|
|
104 |
TUint32 iUserStackBase;
|
|
105 |
TInt iUserStackSize;
|
|
106 |
TUint32 iUserStackHighWatermark;
|
|
107 |
//
|
|
108 |
TUint iSupervisorStackPointer;
|
|
109 |
TUint32 iSupervisorStackBase;
|
|
110 |
TInt iSupervisorStackSize;
|
|
111 |
TUint32 iSupervisorStackHighWatermark;
|
|
112 |
};
|
|
113 |
|
|
114 |
|
|
115 |
/**
|
|
116 |
* Basic thread information block
|
|
117 |
*/
|
|
118 |
class TMemSpyDriverThreadInfoBase
|
|
119 |
{
|
|
120 |
public:
|
|
121 |
// Registers
|
|
122 |
TMemSpyDriverRegSet iCpu;
|
|
123 |
|
|
124 |
// Stack
|
|
125 |
TMemSpyDriverStackInfo iStackInfo;
|
|
126 |
|
|
127 |
// User thread framework
|
|
128 |
RAllocator* iAllocator;
|
|
129 |
CActiveScheduler* iScheduler;
|
|
130 |
};
|
|
131 |
|
|
132 |
|
|
133 |
/**
|
|
134 |
* Thread information block.
|
|
135 |
*/
|
|
136 |
class TMemSpyDriverThreadInfo : public TMemSpyDriverThreadInfoBase
|
|
137 |
{
|
|
138 |
public:
|
|
139 |
TFullName iFullName;
|
|
140 |
|
|
141 |
// Basic properties
|
|
142 |
TUint iPid;
|
|
143 |
TThreadPriority iThreadPriority;
|
|
144 |
|
|
145 |
// Exit information
|
|
146 |
TInt iExitReason;
|
|
147 |
TExitType iExitType;
|
|
148 |
TExitCategoryName iExitCategory;
|
|
149 |
};
|
|
150 |
|
|
151 |
|
|
152 |
/**
|
|
153 |
* Process information block.
|
|
154 |
*/
|
|
155 |
class TMemSpyDriverProcessInfo
|
|
156 |
{
|
|
157 |
public:
|
|
158 |
inline TUint32 SID() const { return iSecurityInfo.iSecureId; }
|
|
159 |
inline TUint32 VID() const { return iSecurityInfo.iVendorId; }
|
|
160 |
|
|
161 |
public:
|
|
162 |
TUidType iUids;
|
|
163 |
TUint32 iFlags;
|
|
164 |
TInt iGeneration;
|
|
165 |
TInt iPriority;
|
|
166 |
SSecurityInfo iSecurityInfo;
|
|
167 |
};
|
|
168 |
|
|
169 |
|
|
170 |
/**
|
|
171 |
* Code Segment Information Block
|
|
172 |
*/
|
|
173 |
class TMemSpyDriverCodeSegInfo
|
|
174 |
{
|
|
175 |
public:
|
|
176 |
inline TMemSpyDriverCodeSegInfo()
|
|
177 |
: iSize( 0 )
|
|
178 |
{
|
|
179 |
}
|
|
180 |
|
|
181 |
public:
|
|
182 |
TUint32 iSize;
|
|
183 |
TCodeSegCreateInfo iCreateInfo;
|
|
184 |
TProcessMemoryInfo iMemoryInfo;
|
|
185 |
};
|
|
186 |
|
|
187 |
|
|
188 |
|
|
189 |
|
|
190 |
|
|
191 |
/**
|
|
192 |
* Generic object related
|
|
193 |
*/
|
|
194 |
class TMemSpyDriverHandleInfoGeneric
|
|
195 |
{
|
|
196 |
public: // Supported for all types
|
|
197 |
TBuf8<KMaxName> iName; // FullName
|
|
198 |
TAny* iHandle;
|
|
199 |
TMemSpyDriverContainerType iType;
|
|
200 |
|
|
201 |
public: // Type-specific members
|
|
202 |
|
|
203 |
// For Process, thread, chunk (owning process id), server (owning thread id)
|
|
204 |
TInt iId;
|
|
205 |
|
|
206 |
// For Chunk, Library
|
|
207 |
TUint32 iSize;
|
|
208 |
|
|
209 |
// For Semaphore, Mutex, Server
|
|
210 |
TInt iCount;
|
|
211 |
|
|
212 |
// For Mutex
|
|
213 |
TInt iWaitCount;
|
|
214 |
|
|
215 |
// For Server, Session
|
|
216 |
TIpcSessionType iSessionType;
|
|
217 |
|
|
218 |
// For Timer
|
|
219 |
TMemSpyDriverTimerType iTimerType;
|
|
220 |
TMemSpyDriverTimerState iTimerState;
|
|
221 |
|
|
222 |
// For Logical channel
|
|
223 |
TInt iOpenChannels;
|
|
224 |
|
|
225 |
// For most of the object types
|
|
226 |
TBuf8<KMaxName> iNameDetail; // Name
|
|
227 |
TInt iAccessCount;
|
|
228 |
TInt iUniqueID;
|
|
229 |
TUint iProtection;
|
|
230 |
TUint8* iAddressOfKernelOwner;
|
|
231 |
TInt iPriority;
|
|
232 |
TUint8* iAddressOfOwningProcess;
|
|
233 |
TUint iCreatorId;
|
|
234 |
TUint iSecurityZone;
|
|
235 |
TInt iAttributes;
|
|
236 |
TUint8* iAddressOfDataBssStackChunk;
|
|
237 |
|
|
238 |
// For Server, Session
|
|
239 |
TUint8* iAddressOfOwningThread;
|
|
240 |
TUint8* iAddressOfServer;
|
|
241 |
TUint16 iTotalAccessCount;
|
|
242 |
TUint8 iSvrSessionType;
|
|
243 |
TInt iMsgCount;
|
|
244 |
TInt iMsgLimit;
|
|
245 |
|
|
246 |
// For chunk
|
|
247 |
TInt iMaxSize;
|
|
248 |
TInt iBottom;
|
|
249 |
TInt iTop;
|
|
250 |
TInt iStartPos;
|
|
251 |
TUint iControllingOwner;
|
|
252 |
TUint iRestrictions;
|
|
253 |
TUint iMapAttr;
|
|
254 |
TUint iChunkType;
|
|
255 |
TBuf8<KMaxName> iNameOfOwner; // chunk, server
|
|
256 |
|
|
257 |
// For library
|
|
258 |
TInt iMapCount;
|
|
259 |
TUint8 iState;
|
|
260 |
TUint8* iAddressOfCodeSeg;
|
|
261 |
|
|
262 |
// Semaphore, mutex, condvar
|
|
263 |
TUint8 iResetting;
|
|
264 |
TUint8 iOrder;
|
|
265 |
|
|
266 |
// For Logical/Physical device
|
|
267 |
TVersion iVersion;
|
|
268 |
TUint iParseMask;
|
|
269 |
TUint iUnitsMask;
|
|
270 |
|
|
271 |
// For change notifier
|
|
272 |
TUint iChanges;
|
|
273 |
};
|
|
274 |
|
|
275 |
|
|
276 |
|
|
277 |
/**
|
|
278 |
*
|
|
279 |
*/
|
|
280 |
class TMemSpyDriverServerSessionInfo
|
|
281 |
{
|
|
282 |
public: // Enumerations
|
|
283 |
enum TOwnerType
|
|
284 |
{
|
|
285 |
EOwnerNone = -1,
|
|
286 |
EOwnerThread = 0,
|
|
287 |
EOwnerProcess
|
|
288 |
};
|
|
289 |
|
|
290 |
public:
|
|
291 |
TInt iOwnerId;
|
|
292 |
TOwnerType iOwnerType;
|
|
293 |
TBuf8<KMaxName> iName;
|
|
294 |
TIpcSessionType iSessionType;
|
|
295 |
TUint8* iAddress;
|
|
296 |
};
|
|
297 |
|
|
298 |
|
|
299 |
|
|
300 |
/**
|
|
301 |
*
|
|
302 |
*/
|
|
303 |
class TMemSpyDriverProcessInspectionInfo
|
|
304 |
{
|
|
305 |
public:
|
|
306 |
inline TMemSpyDriverProcessInspectionInfo()
|
|
307 |
: iProcessId( 0 ),
|
|
308 |
iMemoryHeap( 0 ),
|
|
309 |
iMemoryStack( 0 ),
|
|
310 |
iMemoryGlobalData( 0 ),
|
|
311 |
iMemoryChunkLocal( 0 ),
|
|
312 |
iMemoryChunkShared( 0 )
|
|
313 |
{
|
|
314 |
}
|
|
315 |
|
|
316 |
public: // API
|
|
317 |
inline TUint32 TotalIncShared() const
|
|
318 |
{
|
|
319 |
const TUint32 ret = TotalExcShared() + iMemoryChunkShared;
|
|
320 |
return ret;
|
|
321 |
}
|
|
322 |
|
|
323 |
inline TUint32 TotalExcShared() const
|
|
324 |
{
|
|
325 |
const TUint32 ret = iMemoryHeap + iMemoryStack + iMemoryChunkLocal + iMemoryGlobalData;
|
|
326 |
return ret;
|
|
327 |
}
|
|
328 |
|
|
329 |
public:
|
|
330 |
TUint32 iProcessId;
|
|
331 |
//
|
|
332 |
TUint32 iMemoryHeap;
|
|
333 |
TUint32 iMemoryStack;
|
|
334 |
TUint32 iMemoryGlobalData;
|
|
335 |
TUint32 iMemoryChunkLocal;
|
|
336 |
TUint32 iMemoryChunkShared;
|
|
337 |
//
|
|
338 |
TInt64 iTime;
|
|
339 |
};
|
|
340 |
|
|
341 |
|
|
342 |
|
|
343 |
|
|
344 |
|
|
345 |
|
|
346 |
class TMemSpyHeapInfo
|
|
347 |
{
|
|
348 |
public: // Enumerations
|
|
349 |
enum THeapImplementationType
|
|
350 |
{
|
|
351 |
ETypeUnknown = 0,
|
|
352 |
ETypeRHeap = 1,
|
|
353 |
ETypeRHybridHeap = 2,
|
62
|
354 |
ETypeRHybridHeapV2 = 3,
|
51
|
355 |
};
|
|
356 |
|
|
357 |
public: // Constructor & destructor
|
|
358 |
inline TMemSpyHeapInfo()
|
|
359 |
{
|
|
360 |
}
|
|
361 |
|
|
362 |
public: // API
|
|
363 |
inline void SetType( THeapImplementationType aType ) { iType = aType; }
|
|
364 |
inline THeapImplementationType Type() const { return iType; }
|
|
365 |
//
|
|
366 |
inline TMemSpyHeapInfoRHeap& AsRHeap() { return iRHeap; }
|
|
367 |
inline const TMemSpyHeapInfoRHeap& AsRHeap() const { return iRHeap; }
|
|
368 |
//
|
|
369 |
inline void SetTid( TUint32 aId ) { iTid = aId; }
|
|
370 |
inline TUint32 Tid() const { return iTid; }
|
|
371 |
//
|
|
372 |
inline void SetPid( TUint32 aId ) { iPid = aId; }
|
|
373 |
inline TUint32 Pid() const { return iPid; }
|
|
374 |
|
|
375 |
private: // Data members
|
|
376 |
THeapImplementationType iType;
|
|
377 |
TMemSpyHeapInfoRHeap iRHeap;
|
|
378 |
TUint32 iPid;
|
|
379 |
TUint32 iTid;
|
|
380 |
};
|
|
381 |
|
|
382 |
|
|
383 |
|
|
384 |
|
|
385 |
|
|
386 |
|
|
387 |
/**
|
|
388 |
* Chunk info base class
|
|
389 |
*/
|
|
390 |
class TMemSpyDriverChunkInfoWithoutName
|
|
391 |
{
|
|
392 |
public:
|
|
393 |
inline TMemSpyDriverChunkInfoWithoutName()
|
|
394 |
: iHandle( NULL ),
|
|
395 |
iBaseAddress( NULL ),
|
|
396 |
iSize( 0 ),
|
|
397 |
iMaxSize( 0 ),
|
|
398 |
iOwnerId( 0 ),
|
|
399 |
iType( EMemSpyDriverChunkTypeUnknown )
|
|
400 |
{
|
|
401 |
}
|
|
402 |
|
|
403 |
public:
|
|
404 |
TAny* iHandle;
|
|
405 |
TAny* iBaseAddress;
|
|
406 |
TUint iSize;
|
|
407 |
TUint iMaxSize;
|
|
408 |
TUint iOwnerId;
|
|
409 |
TMemSpyDriverChunkType iType;
|
|
410 |
TInt iAttributes;
|
|
411 |
};
|
|
412 |
|
|
413 |
|
|
414 |
/**
|
|
415 |
* Chunk info
|
|
416 |
*/
|
|
417 |
class TMemSpyDriverChunkInfo : public TMemSpyDriverChunkInfoWithoutName
|
|
418 |
{
|
|
419 |
public:
|
|
420 |
inline TMemSpyDriverChunkInfo()
|
|
421 |
: TMemSpyDriverChunkInfoWithoutName(),
|
|
422 |
iName( KNullDesC )
|
|
423 |
{
|
|
424 |
}
|
|
425 |
|
|
426 |
public:
|
|
427 |
TFullName iName;
|
|
428 |
};
|
|
429 |
|
|
430 |
|
|
431 |
/**
|
|
432 |
* cell information
|
|
433 |
*/
|
|
434 |
class TMemSpyDriverFreeCell
|
|
435 |
{
|
|
436 |
public:
|
|
437 |
TMemSpyDriverCellType iType;
|
|
438 |
TAny* iAddress;
|
|
439 |
TInt iLength;
|
|
440 |
};
|
|
441 |
|
|
442 |
// For compatibility I can't change TMemSpyDriverCell to be the class and typdef/derive TMemSpyDriverFreeCell. Sigh...
|
|
443 |
typedef TMemSpyDriverFreeCell TMemSpyDriverCell;
|
|
444 |
|
|
445 |
|
|
446 |
/**
|
|
447 |
* P&S information
|
|
448 |
*/
|
|
449 |
class TMemSpyDriverPAndSInfo
|
|
450 |
{
|
|
451 |
public:
|
|
452 |
RProperty::TType iType;
|
|
453 |
TUint iCategory;
|
|
454 |
TUint iKey;
|
|
455 |
TInt iRefCount;
|
|
456 |
TUint32 iTid;
|
|
457 |
TUint32 iCreatorSID;
|
|
458 |
};
|
|
459 |
|
|
460 |
|
|
461 |
/**
|
|
462 |
* CondVar suspended thread information
|
|
463 |
*/
|
|
464 |
class TMemSpyDriverCondVarSuspendedThreadInfo
|
|
465 |
{
|
|
466 |
public:
|
|
467 |
TBuf8<KMaxName> iName;
|
|
468 |
TUint8* iAddress;
|
|
469 |
};
|
|
470 |
|
|
471 |
#endif
|