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 MEMSPYDRIVEROSADAPTION_H |
|
19 #define MEMSPYDRIVEROSADAPTION_H |
|
20 |
|
21 // System includes |
|
22 #include <kernel.h> |
|
23 #include <e32const.h> |
|
24 |
|
25 // User includes |
|
26 #include "MemSpyDriverObjectIx.h" |
|
27 |
|
28 // Classes referenced |
|
29 class DMemSpyDriverDevice; |
|
30 class DMemSpyPropertyRef; |
|
31 class DMemSpyDriverOSAdaption; |
|
32 |
|
33 |
|
34 |
|
35 class DMemSpyDriverOSAdaptionDObject : public DBase |
|
36 { |
|
37 protected: |
|
38 DMemSpyDriverOSAdaptionDObject( DMemSpyDriverOSAdaption& aOSAdaption ); |
|
39 |
|
40 public: |
|
41 TUint8 GetContainerID( DObject& aObject ) const; |
|
42 TObjectType GetObjectType( DObject& aObject ) const; |
|
43 DObject* GetOwner( DObject& aObject ) const; |
|
44 DObject* GetOwner( DObject& aObject, TUint8 aExpectedContainerId ) const; |
|
45 TInt GetAccessCount( DObject& aObject ) const; |
|
46 TInt GetUniqueID( DObject& aObject ) const; |
|
47 TUint GetProtection( DObject& aObject ) const; |
|
48 TUint8* GetAddressOfKernelOwner( DObject& aObject ) const; |
|
49 |
|
50 protected: |
|
51 DMemSpyDriverOSAdaption& OSAdaption() const { return iOSAdaption; } |
|
52 |
|
53 private: // Data members |
|
54 DMemSpyDriverOSAdaption& iOSAdaption; |
|
55 }; |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 class DMemSpyDriverOSAdaptionDThread : public DMemSpyDriverOSAdaptionDObject |
|
62 { |
|
63 public: |
|
64 DMemSpyDriverOSAdaptionDThread( DMemSpyDriverOSAdaption& aOSAdaption ); |
|
65 |
|
66 public: |
|
67 NThread* GetNThread( DThread& aObject ) const; |
|
68 TExitType GetExitType( DThread& aObject ) const; |
|
69 TUint32 GetSupervisorStackBase( DThread& aObject ) const; |
|
70 TInt GetSupervisorStackSize( DThread& aObject ) const; |
|
71 RAllocator* GetAllocator( DThread& aObject ) const; |
|
72 CActiveScheduler* GetActiveScheduler( DThread& aObject ) const; |
|
73 TUint32 GetUserStackBase( DThread& aObject ) const; |
|
74 TInt GetUserStackSize( DThread& aObject ) const; |
|
75 DProcess* GetOwningProcess( DThread& aObject ) const; |
|
76 TUint GetId( DThread& aObject ) const; |
|
77 MemSpyObjectIx* GetHandles( DThread& aObject ) const; |
|
78 TUint GetOwningProcessId( DThread& aObject ) const; |
|
79 TInt GetPriority( DThread& aObject ) const; |
|
80 TUint8* GetAddressOfOwningProcess( DThread& aObject ) const; |
|
81 void GetNameOfOwningProcess( DThread& aObject, TDes& aName ) const; |
|
82 TBool IsHandleIndexValid( DThread& aObject ) const; |
|
83 |
|
84 private: // Internal methods |
|
85 RAllocator* GetAllocatorAndStackAddress( DThread& aObject, TUint32& aStackAddress ) const; |
|
86 |
|
87 private: // Data members |
|
88 TUint32 iOffset_NThread; |
|
89 TUint32 iOffset_ExitType; |
|
90 TUint32 iOffset_SupervisorStackBase; |
|
91 TUint32 iOffset_SupervisorStackSize; |
|
92 }; |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 class DMemSpyDriverOSAdaptionDProcess : public DMemSpyDriverOSAdaptionDObject |
|
101 { |
|
102 public: |
|
103 DMemSpyDriverOSAdaptionDProcess( DMemSpyDriverOSAdaption& aOSAdaption ); |
|
104 |
|
105 public: |
|
106 TUint GetId( DProcess& aObject ) const; |
|
107 MemSpyObjectIx* GetHandles( DProcess& aObject ) const; |
|
108 TExitType GetExitType( DProcess& aObject ) const; |
|
109 DThread* OpenFirstThread( DProcess& aObject ) const; |
|
110 TUint32 GetSID( DProcess& aObject ) const; |
|
111 TUint GetSecurityZone( DProcess& aObject ) const; |
|
112 SSecurityInfo& GetSecurityInfo( DProcess& aObject ) const; |
|
113 TInt GetFlags( DProcess& aObject ) const; |
|
114 TInt GetGeneration( DProcess& aObject ) const; |
|
115 SDblQue& GetThreadQueue( DProcess& aObject ) const; |
|
116 DThread* GetThread( SDblQueLink* aLink ) const; |
|
117 void SetSID( DProcess& aObject, TUint32 aSID ) const; |
|
118 void SetSecurityZone( DProcess& aObject, TUint aSecurityZone ) const; |
|
119 TUint GetCreatorId( DProcess& aObject ) const; |
|
120 TInt GetAttributes( DProcess& aObject ) const; |
|
121 TInt GetPriority( DProcess& aObject ) const; |
|
122 TUint8* GetAddressOfOwningProcess( DProcess& aObject ) const; |
|
123 TUint8* GetAddressOfDataBssStackChunk( DProcess& aObject ) const; |
|
124 TBool IsHandleIndexValid( DProcess& aObject ) const; |
|
125 TBool IsKernProcess(DProcess& aProcess) const; |
|
126 |
|
127 private: // Data members |
|
128 }; |
|
129 |
|
130 |
|
131 |
|
132 |
|
133 |
|
134 |
|
135 |
|
136 |
|
137 |
|
138 |
|
139 |
|
140 |
|
141 |
|
142 |
|
143 |
|
144 class DMemSpyDriverOSAdaptionDChunk : public DMemSpyDriverOSAdaptionDObject |
|
145 { |
|
146 public: |
|
147 DMemSpyDriverOSAdaptionDChunk( DMemSpyDriverOSAdaption& aOSAdaption ); |
|
148 |
|
149 public: |
|
150 TInt GetSize( DChunk& aObject ) const; |
|
151 TInt GetMaxSize( DChunk& aObject ) const; |
|
152 TUint8* GetBase( DChunk& aObject ) const; |
|
153 DProcess* GetOwningProcess( DChunk& aObject ) const; |
|
154 TUint GetOwningProcessId( DChunk& aObject ) const; |
|
155 TUint GetControllingOwnerId( DChunk& aObject ) const; |
|
156 TChunkType GetType( DChunk& aObject ) const; |
|
157 TInt GetAttributes( DChunk& aObject ) const; |
|
158 TUint8* GetAddressOfOwningProcess( DChunk& aObject ) const; |
|
159 TInt GetBottom( DChunk& aObject ) const; |
|
160 TInt GetTop( DChunk& aObject ) const; |
|
161 TInt GetStartPos( DChunk& aObject ) const; |
|
162 TUint GetRestrictions( DChunk& aObject ) const; |
|
163 TUint GetMapAttr( DChunk& aObject ) const; |
|
164 void GetNameOfOwningProcess( DChunk& aObject, TDes& aName ) const; |
|
165 |
|
166 private: // Data members |
|
167 }; |
|
168 |
|
169 |
|
170 |
|
171 |
|
172 |
|
173 |
|
174 |
|
175 |
|
176 class DMemSpyDriverOSAdaptionDServer : public DMemSpyDriverOSAdaptionDObject |
|
177 { |
|
178 public: |
|
179 DMemSpyDriverOSAdaptionDServer( DMemSpyDriverOSAdaption& aOSAdaption ); |
|
180 |
|
181 public: |
|
182 SDblQue& GetSessionQueue( DServer& aObject ) const; |
|
183 DSession* GetSession( SDblQueLink* aLink ) const; |
|
184 TInt GetSessionCount( DServer& aObject ) const; |
|
185 DThread* GetOwningThread( DServer& aObject ) const; |
|
186 TUint GetOwningThreadId( DServer& aObject ) const; |
|
187 TIpcSessionType GetSessionType( DServer& aObject ) const; |
|
188 TUint8* GetAddressOfOwningThread( DServer& aObject ) const; |
|
189 void GetNameOfOwningThread( DServer& aObject, TDes& aName ) const; |
|
190 |
|
191 private: // Data members |
|
192 }; |
|
193 |
|
194 |
|
195 |
|
196 |
|
197 |
|
198 |
|
199 |
|
200 class DMemSpyDriverOSAdaptionDSession : public DMemSpyDriverOSAdaptionDObject |
|
201 { |
|
202 public: |
|
203 DMemSpyDriverOSAdaptionDSession( DMemSpyDriverOSAdaption& aOSAdaption ); |
|
204 |
|
205 public: |
|
206 TIpcSessionType GetSessionType( DSession& aObject ) const; |
|
207 DServer* GetServer( DSession& aObject ) const; |
|
208 TUint8* GetAddressOfServer( DSession& aObject ) const; |
|
209 TUint16 GetTotalAccessCount( DSession& aObject ) const; |
|
210 TUint8 GetSrvSessionType( DSession& aObject ) const; |
|
211 TInt GetMsgCount( DSession& aObject ) const; |
|
212 TInt GetMsgLimit( DSession& aObject ) const; |
|
213 |
|
214 private: // Data members |
|
215 }; |
|
216 |
|
217 |
|
218 |
|
219 |
|
220 |
|
221 |
|
222 |
|
223 |
|
224 |
|
225 class DMemSpyDriverOSAdaptionDCodeSeg : public DMemSpyDriverOSAdaptionDObject |
|
226 { |
|
227 public: |
|
228 DMemSpyDriverOSAdaptionDCodeSeg( DMemSpyDriverOSAdaption& aOSAdaption ); |
|
229 |
|
230 public: |
|
231 DCodeSeg* GetCodeSeg( SDblQueLink* aLink ) const; |
|
232 DCodeSeg* GetCodeSeg( DLibrary& aLibrary ) const; |
|
233 DCodeSeg* GetCodeSegFromHandle( TAny* aHandle ) const; |
|
234 TBool GetIsXIP( DCodeSeg& aCodeSeg ) const; |
|
235 TInt GetCodeSegQueue( DProcess& aObject, SDblQue& aQueue ) const; |
|
236 void EmptyCodeSegQueue( SDblQue& aQueue ) const; |
|
237 TUint32 GetSize( DCodeSeg& aCodeSeg ) const; |
|
238 void GetCreateInfo( DCodeSeg& aCodeSeg, TCodeSegCreateInfo& aInfo ) const; |
|
239 TUint8 GetState( DLibrary& aLibrary ) const; |
|
240 TInt GetMapCount( DLibrary& aLibrary ) const; |
|
241 |
|
242 private: // Data members |
|
243 }; |
|
244 |
|
245 |
|
246 |
|
247 |
|
248 |
|
249 class DMemSpyDriverOSAdaptionDSemaphore : public DMemSpyDriverOSAdaptionDObject |
|
250 { |
|
251 public: |
|
252 DMemSpyDriverOSAdaptionDSemaphore( DMemSpyDriverOSAdaption& aOSAdaption ); |
|
253 |
|
254 public: |
|
255 TInt GetCount( DSemaphore& aObject ) const; |
|
256 TUint8 GetResetting( DSemaphore& aObject ) const; |
|
257 |
|
258 private: // Data members |
|
259 }; |
|
260 |
|
261 |
|
262 |
|
263 |
|
264 |
|
265 |
|
266 |
|
267 |
|
268 |
|
269 class DMemSpyDriverOSAdaptionDMutex : public DMemSpyDriverOSAdaptionDObject |
|
270 { |
|
271 public: |
|
272 DMemSpyDriverOSAdaptionDMutex( DMemSpyDriverOSAdaption& aOSAdaption ); |
|
273 |
|
274 public: |
|
275 TInt GetHoldCount( DMutex& aObject ) const; |
|
276 TInt GetWaitCount( DMutex& aObject ) const; |
|
277 TUint8 GetResetting( DMutex& aObject ) const; |
|
278 TUint8 GetOrder( DMutex& aObject ) const; |
|
279 |
|
280 private: // Data members |
|
281 }; |
|
282 |
|
283 |
|
284 |
|
285 |
|
286 |
|
287 |
|
288 |
|
289 |
|
290 class DMemSpyDriverOSAdaptionDLogicalDevice : public DMemSpyDriverOSAdaptionDObject |
|
291 { |
|
292 public: |
|
293 DMemSpyDriverOSAdaptionDLogicalDevice( DMemSpyDriverOSAdaption& aOSAdaption ); |
|
294 |
|
295 public: |
|
296 TInt GetOpenChannels( DLogicalDevice& aObject ) const; |
|
297 TVersion GetVersion( DLogicalDevice& aObject ) const; |
|
298 TUint GetParseMask( DLogicalDevice& aObject ) const; |
|
299 TUint GetUnitsMask( DLogicalDevice& aObject ) const; |
|
300 |
|
301 private: // Data members |
|
302 }; |
|
303 |
|
304 |
|
305 |
|
306 |
|
307 |
|
308 |
|
309 |
|
310 |
|
311 |
|
312 class DMemSpyDriverOSAdaptionDPhysicalDevice : public DMemSpyDriverOSAdaptionDObject |
|
313 { |
|
314 public: |
|
315 DMemSpyDriverOSAdaptionDPhysicalDevice( DMemSpyDriverOSAdaption& aOSAdaption ); |
|
316 |
|
317 public: |
|
318 TVersion GetVersion( DPhysicalDevice& aObject ) const; |
|
319 TUint GetUnitsMask( DPhysicalDevice& aObject ) const; |
|
320 TUint8* GetAddressOfCodeSeg( DPhysicalDevice& aObject ) const; |
|
321 |
|
322 private: // Data members |
|
323 }; |
|
324 |
|
325 |
|
326 |
|
327 |
|
328 |
|
329 |
|
330 |
|
331 |
|
332 |
|
333 |
|
334 |
|
335 class DMemSpyDriverOSAdaptionDChangeNotifier : public DMemSpyDriverOSAdaptionDObject |
|
336 { |
|
337 public: |
|
338 DMemSpyDriverOSAdaptionDChangeNotifier( DMemSpyDriverOSAdaption& aOSAdaption ); |
|
339 |
|
340 public: |
|
341 TUint GetChanges( DChangeNotifier& aObject ) const; |
|
342 TUint8* GetAddressOfOwningThread( DChangeNotifier& aObject ) const; |
|
343 void GetNameOfOwningThread( DChangeNotifier& aObject, TDes& aName ) const; |
|
344 |
|
345 private: // Data members |
|
346 }; |
|
347 |
|
348 |
|
349 |
|
350 |
|
351 |
|
352 |
|
353 |
|
354 |
|
355 |
|
356 |
|
357 |
|
358 class DMemSpyDriverOSAdaptionDUndertaker : public DMemSpyDriverOSAdaptionDObject |
|
359 { |
|
360 public: |
|
361 DMemSpyDriverOSAdaptionDUndertaker( DMemSpyDriverOSAdaption& aOSAdaption ); |
|
362 |
|
363 public: |
|
364 TUint8* GetAddressOfOwningThread( DUndertaker& aObject ) const; |
|
365 void GetNameOfOwningThread( DUndertaker& aObject, TDes& aName ) const; |
|
366 |
|
367 private: // Data members |
|
368 }; |
|
369 |
|
370 |
|
371 |
|
372 |
|
373 |
|
374 |
|
375 |
|
376 |
|
377 |
|
378 |
|
379 |
|
380 |
|
381 class DMemSpyDriverOSAdaptionDCondVar : public DMemSpyDriverOSAdaptionDObject |
|
382 { |
|
383 public: |
|
384 DMemSpyDriverOSAdaptionDCondVar( DMemSpyDriverOSAdaption& aOSAdaption ); |
|
385 |
|
386 public: |
|
387 TUint8 GetResetting( DCondVar& aObject ) const; |
|
388 TUint8* GetAddressOfMutex( DCondVar& aObject ) const; |
|
389 void GetNameOfMutex( DCondVar& aObject, TDes& aName ) const; |
|
390 TInt GetWaitCount( DCondVar& aObject ) const; |
|
391 SDblQue& GetSuspendedQ( DCondVar& aObject ) const; |
|
392 DThread* GetThread( SDblQueLink* aLink ) const; |
|
393 |
|
394 private: // Data members |
|
395 }; |
|
396 |
|
397 |
|
398 |
|
399 |
|
400 |
|
401 |
|
402 |
|
403 |
|
404 |
|
405 |
|
406 |
|
407 |
|
408 |
|
409 |
|
410 |
|
411 class DMemSpyDriverOSAdaptionDTimer : public DMemSpyDriverOSAdaptionDObject |
|
412 { |
|
413 public: |
|
414 DMemSpyDriverOSAdaptionDTimer( DMemSpyDriverOSAdaption& aOSAdaption ); |
|
415 |
|
416 public: |
|
417 TTimer::TTimerType GetType( DTimer& aObject ) const; |
|
418 TTimer::TTimerState GetState( DTimer& aObject ) const; |
|
419 |
|
420 private: // Data members |
|
421 }; |
|
422 |
|
423 |
|
424 |
|
425 |
|
426 |
|
427 class DMemSpyDriverOSAdaptionDPropertyRef : public DMemSpyDriverOSAdaptionDObject |
|
428 { |
|
429 public: |
|
430 DMemSpyDriverOSAdaptionDPropertyRef( DMemSpyDriverOSAdaption& aOSAdaption ); |
|
431 |
|
432 public: |
|
433 TBool GetIsReady( DObject& aObject ) const; |
|
434 RProperty::TType GetType( DObject& aObject ) const; |
|
435 TUint GetCategory( DObject& aObject ) const; |
|
436 TUint GetKey( DObject& aObject ) const; |
|
437 TInt GetRefCount( DObject& aObject ) const; |
|
438 TUint GetThreadId( DObject& aObject ) const; |
|
439 TUint32 GetCreatorSID( DObject& aObject ) const; |
|
440 |
|
441 private: // Internal methods |
|
442 DMemSpyPropertyRef* GetPropertyRef( DObject& aObject ) const; |
|
443 |
|
444 private: // Data members |
|
445 }; |
|
446 |
|
447 |
|
448 |
|
449 |
|
450 |
|
451 |
|
452 class DMemSpyDriverOSAdaption : public DBase |
|
453 { |
|
454 public: |
|
455 DMemSpyDriverOSAdaption( DMemSpyDriverDevice& aDevice ); |
|
456 ~DMemSpyDriverOSAdaption(); |
|
457 TInt Construct(); |
|
458 |
|
459 public: // API |
|
460 inline DMemSpyDriverDevice& Device() { return iDevice; } |
|
461 inline DMemSpyDriverOSAdaptionDProcess& DProcess() { return *iDProcess; } |
|
462 inline DMemSpyDriverOSAdaptionDThread& DThread() { return *iDThread; } |
|
463 inline DMemSpyDriverOSAdaptionDChunk& DChunk() { return *iDChunk; } |
|
464 inline DMemSpyDriverOSAdaptionDServer& DServer() { return *iDServer; } |
|
465 inline DMemSpyDriverOSAdaptionDSession& DSession() { return *iDSession; } |
|
466 inline DMemSpyDriverOSAdaptionDCodeSeg& DCodeSeg() { return *iDCodeSeg; } |
|
467 inline DMemSpyDriverOSAdaptionDSemaphore& DSemaphore() { return *iDSemaphore; } |
|
468 inline DMemSpyDriverOSAdaptionDMutex& DMutex() { return *iDMutex; } |
|
469 inline DMemSpyDriverOSAdaptionDLogicalDevice& DLogicalDevice() { return *iDLogicalDevice; } |
|
470 inline DMemSpyDriverOSAdaptionDPhysicalDevice& DPhysicalDevice() { return *iDPhysicalDevice; } |
|
471 inline DMemSpyDriverOSAdaptionDChangeNotifier& DChangeNotifier() { return *iDChangeNotifier; } |
|
472 inline DMemSpyDriverOSAdaptionDUndertaker& DUndertaker() { return *iDUndertaker; } |
|
473 inline DMemSpyDriverOSAdaptionDCondVar& DCondVar() { return *iDCondVar; } |
|
474 inline DMemSpyDriverOSAdaptionDTimer& DTimer() { return *iDTimer; } |
|
475 inline DMemSpyDriverOSAdaptionDPropertyRef& DPropertyRef() { return *iDPropertyRef; } |
|
476 |
|
477 private: // Data members |
|
478 DMemSpyDriverDevice& iDevice; |
|
479 DMemSpyDriverOSAdaptionDThread* iDThread; |
|
480 DMemSpyDriverOSAdaptionDProcess* iDProcess; |
|
481 DMemSpyDriverOSAdaptionDChunk* iDChunk; |
|
482 DMemSpyDriverOSAdaptionDServer* iDServer; |
|
483 DMemSpyDriverOSAdaptionDSession* iDSession; |
|
484 DMemSpyDriverOSAdaptionDCodeSeg* iDCodeSeg; |
|
485 DMemSpyDriverOSAdaptionDSemaphore* iDSemaphore; |
|
486 DMemSpyDriverOSAdaptionDMutex* iDMutex; |
|
487 DMemSpyDriverOSAdaptionDLogicalDevice* iDLogicalDevice; |
|
488 DMemSpyDriverOSAdaptionDPhysicalDevice* iDPhysicalDevice; |
|
489 DMemSpyDriverOSAdaptionDChangeNotifier* iDChangeNotifier; |
|
490 DMemSpyDriverOSAdaptionDUndertaker* iDUndertaker; |
|
491 DMemSpyDriverOSAdaptionDCondVar* iDCondVar; |
|
492 DMemSpyDriverOSAdaptionDTimer* iDTimer; |
|
493 DMemSpyDriverOSAdaptionDPropertyRef* iDPropertyRef; |
|
494 }; |
|
495 |
|
496 |
|
497 // KNOWN OMISSIONS: |
|
498 // |
|
499 // + kernel container listing & query interface |
|
500 // + event handler (events: process, threads, code segs, chunks, ... ) |
|
501 // + kernel heap information |
|
502 // + end thread / process |
|
503 |
|
504 |
|
505 #endif |
|