28 #include <memspy/driver/memspydriverobjectsshared.h> |
28 #include <memspy/driver/memspydriverobjectsshared.h> |
29 #include <memspy/driver/memspydriverenumerationsshared.h> |
29 #include <memspy/driver/memspydriverenumerationsshared.h> |
30 |
30 |
31 |
31 |
32 class RMemSpyDriverClient : public RBusLogicalChannel |
32 class RMemSpyDriverClient : public RBusLogicalChannel |
33 { |
33 { |
34 public: // GENERAL API |
34 public: // GENERAL API |
35 |
35 |
36 /** |
36 /** |
37 * |
37 * |
38 */ |
38 */ |
39 IMPORT_C TInt Open(); |
39 IMPORT_C TInt Open(); |
40 |
40 |
41 /** |
41 /** |
42 * |
42 * |
43 */ |
43 */ |
44 IMPORT_C void Close(); |
44 IMPORT_C void Close(); |
45 |
45 |
46 /** |
46 /** |
47 * |
47 * |
48 */ |
48 */ |
49 IMPORT_C void GetVersion( TVersion& aVersion ); |
49 IMPORT_C void GetVersion( TVersion& aVersion ); |
52 public: // RAW MEMORY |
52 public: // RAW MEMORY |
53 |
53 |
54 /** |
54 /** |
55 * |
55 * |
56 */ |
56 */ |
57 IMPORT_C TInt ReadMemory( TUint aTid, TLinAddr aSrc, TDes8& aDest ); |
57 IMPORT_C TInt ReadMemory( TUint aTid, TLinAddr aSrc, TDes8& aDest ); |
58 |
58 |
59 |
59 |
60 public: // CODE SEGS |
60 public: // CODE SEGS |
61 |
61 |
62 /** |
62 /** |
63 * |
63 * |
64 */ |
64 */ |
65 IMPORT_C TInt GetCodeSegs( TAny** aHandleArray, TInt& aHandleCount, TBool aOnlyRamLoaded = EFalse ); |
65 IMPORT_C TInt GetCodeSegs( TAny** aHandleArray, TInt& aHandleCount, TBool aOnlyRamLoaded = EFalse ); |
66 |
66 |
67 /** |
67 /** |
68 * |
68 * |
69 */ |
69 */ |
70 IMPORT_C TInt GetCodeSegs( TUint aPid, TAny** aHandleArray, TInt& aHandleCount ); |
70 IMPORT_C TInt GetCodeSegs( TUint aPid, TAny** aHandleArray, TInt& aHandleCount ); |
71 |
71 |
72 /** |
72 /** |
73 * |
73 * |
74 */ |
74 */ |
75 IMPORT_C TInt GetCodeSegInfo( TAny* aHandle, TUint aPid, TMemSpyDriverCodeSegInfo& aInfo ); |
75 IMPORT_C TInt GetCodeSegInfo( TAny* aHandle, TUint aPid, TMemSpyDriverCodeSegInfo& aInfo ); |
76 |
76 |
77 |
77 |
78 public: // CHUNKS |
78 public: // CHUNKS |
79 |
79 |
80 /** |
80 /** |
148 /** |
148 /** |
149 * |
149 * |
150 */ |
150 */ |
151 IMPORT_C TInt SetPriority( TUint aId, TThreadPriority aPriority ); |
151 IMPORT_C TInt SetPriority( TUint aId, TThreadPriority aPriority ); |
152 |
152 |
|
153 |
|
154 public: // HEAP KERNEL COPY |
|
155 |
|
156 /** |
|
157 * Creates a copy of the kernel heap so long running operations (like dumping the heap data) |
|
158 * don't need to lock the kernel heap. |
|
159 * |
|
160 * At most one copy of the kernel heap is held at a time. Each time this function is called the |
|
161 * previous copy, if any, is erased. |
|
162 */ |
|
163 IMPORT_C TInt CopyHeapDataKernel(); |
|
164 /** |
|
165 * Frees the copy made using CopyHeapDataKernel() |
|
166 */ |
|
167 IMPORT_C TInt FreeHeapDataKernel(); |
|
168 |
153 public: // HEAP INFO |
169 public: // HEAP INFO |
154 |
170 |
155 /** |
171 /** |
156 * |
172 * |
157 */ |
173 */ |
158 IMPORT_C TInt GetHeapInfoUser( TMemSpyHeapInfo& aInfo, TUint aTid ); |
174 IMPORT_C TInt GetHeapInfoUser( TMemSpyHeapInfo& aInfo, TUint aTid ); |
159 IMPORT_C TInt GetHeapInfoUser( TMemSpyHeapInfo& aInfo, TUint aTid, RArray<TMemSpyDriverFreeCell>& aFreeCells ); |
175 IMPORT_C TInt GetHeapInfoUser( TMemSpyHeapInfo& aInfo, TUint aTid, RArray<TMemSpyDriverFreeCell>& aFreeCells ); |
160 IMPORT_C TInt GetHeapInfoUser(TMemSpyHeapInfo& aInfo, TUint aTid, RArray<TMemSpyDriverCell>& aCells, TBool aCollectAllocatedCellsAsWellAsFree); |
176 IMPORT_C TInt GetHeapInfoUser(TMemSpyHeapInfo& aInfo, TUint aTid, RArray<TMemSpyDriverCell>& aCells, TBool aCollectAllocatedCellsAsWellAsFree); |
161 |
177 |
162 /** |
178 /** |
163 * |
179 * |
164 */ |
180 */ |
165 IMPORT_C TInt GetHeapInfoKernel( TMemSpyHeapInfo& aInfo ); |
181 IMPORT_C TInt GetHeapInfoKernel( TMemSpyHeapInfo& aInfo ); |
166 IMPORT_C TInt GetHeapInfoKernel( TMemSpyHeapInfo& aInfo, RArray<TMemSpyDriverFreeCell>& aFreeCells ); |
182 IMPORT_C TInt GetHeapInfoKernel( TMemSpyHeapInfo& aInfo, RArray<TMemSpyDriverFreeCell>& aFreeCells ); |
|
183 IMPORT_C TInt GetHeapInfoKernel( TMemSpyHeapInfo& aInfo, RArray<TMemSpyDriverCell>& aCells, TBool aCollectAllocatedCellsAsWellAsFree); |
|
184 IMPORT_C TInt GetHeapInfoKernel( TMemSpyHeapInfo& aInfo, RArray<TMemSpyDriverCell>& aCells, TBool aCollectAllocatedCellsAsWellAsFree, TBool aUseKernelCopy); |
|
185 |
167 |
186 |
168 public: // HEAP DATA |
187 public: // HEAP DATA |
169 |
188 |
170 /** |
189 /** |
171 * Get free cell data. If aFreeCellChecksum is 0, then no checksum comparison is performed. |
190 * Get free cell data. If aFreeCellChecksum is 0, then no checksum comparison is performed. |
176 * |
195 * |
177 */ |
196 */ |
178 IMPORT_C TInt GetHeapDataNext( TUint aTid, TDes8& aDest, TUint& aReadAddress, TUint& aAmountRemaining ); |
197 IMPORT_C TInt GetHeapDataNext( TUint aTid, TDes8& aDest, TUint& aReadAddress, TUint& aAmountRemaining ); |
179 |
198 |
180 /** |
199 /** |
181 * |
200 * Get free cell data. If aFreeCellChecksum is 0, then no checksum comparison is performed. |
182 */ |
201 * @pre must be called after CopyHeapDataKernel() |
183 IMPORT_C HBufC8* GetHeapDataKernelLC( TMemSpyHeapInfo& aInfo, RArray<TMemSpyDriverFreeCell>& aFreeCells ); |
202 */ |
184 |
203 IMPORT_C TInt GetHeapDataKernel( TUint aTid, TDes8& aDest, TUint& aReadAddress, TUint& aAmountRemaining ); |
|
204 |
|
205 /** |
|
206 * @pre must be called after GetHeapDataKernelNext() |
|
207 */ |
|
208 IMPORT_C TInt GetHeapDataKernelNext( TUint aTid, TDes8& aDest, TUint& aReadAddress, TUint& aAmountRemaining ); |
|
209 |
185 |
210 |
186 public: // HEAP WALK |
211 public: // HEAP WALK |
187 |
212 |
188 /** |
213 /** |
189 * |
214 * |
288 public: // Handles related |
313 public: // Handles related |
289 |
314 |
290 /** |
315 /** |
291 * Get all of the handles in a specific container |
316 * Get all of the handles in a specific container |
292 */ |
317 */ |
293 IMPORT_C TInt GetContainerHandles( TMemSpyDriverContainerType aContainer, TAny** aHandleArray, TInt& aHandleCount ); |
318 IMPORT_C TInt GetContainerHandles( TMemSpyDriverContainerType aContainer, TAny** aHandleArray, TInt& aHandleCount ); |
294 |
319 |
295 /** |
320 /** |
296 * Get all handles of a specific type, for a specific thread. |
321 * Get all handles of a specific type, for a specific thread. |
297 */ |
322 */ |
298 IMPORT_C TInt GetThreadHandlesByType( TInt aTid, TMemSpyDriverContainerType aType, TAny** aHandleArray, TInt& aHandleCount ); |
323 IMPORT_C TInt GetThreadHandlesByType( TInt aTid, TMemSpyDriverContainerType aType, TAny** aHandleArray, TInt& aHandleCount ); |
299 |
324 |
300 /** |
325 /** |
301 * Get all handles of a specific type, for a specific process. |
326 * Get all handles of a specific type, for a specific process. |
302 */ |
327 */ |
303 IMPORT_C TInt GetProcessHandlesByType( TInt aPid, TMemSpyDriverContainerType aType, TAny** aHandleArray, TInt& aHandleCount ); |
328 IMPORT_C TInt GetProcessHandlesByType( TInt aPid, TMemSpyDriverContainerType aType, TAny** aHandleArray, TInt& aHandleCount ); |
304 |
329 |
305 /** |
330 /** |
306 * Get handle info for a specific handle owner by a specific thread. If the handle is not thread-specific, then |
331 * Get handle info for a specific handle owner by a specific thread. If the handle is not thread-specific, then |
307 * use KMemSpyDriverEnumerateContainerHandles as the aTid parameter. |
332 * use KMemSpyDriverEnumerateContainerHandles as the aTid parameter. |
308 */ |
333 */ |
323 * |
348 * |
324 * This method can be used to search all of the other handle containers within other threads & processes |
349 * This method can be used to search all of the other handle containers within other threads & processes |
325 * to see if any of those handle containers happen to reference the specified thread or process (as defined by |
350 * to see if any of those handle containers happen to reference the specified thread or process (as defined by |
326 * aTid or aPid). |
351 * aTid or aPid). |
327 */ |
352 */ |
328 IMPORT_C TInt GetReferencesToMyThread( TUint aTid ); |
353 IMPORT_C TInt GetReferencesToMyThread( TUint aTid ); |
329 IMPORT_C TInt GetReferencesToMyProcess( TUint aPid ); |
354 IMPORT_C TInt GetReferencesToMyProcess( TUint aPid ); |
330 |
355 |
331 /** |
356 /** |
332 * Get info about a P&S kernel object |
357 * Get info about a P&S kernel object |
333 */ |
358 */ |
334 IMPORT_C TInt GetPAndSInfo( TAny* aHandle, TMemSpyDriverPAndSInfo& aInfo ); |
359 IMPORT_C TInt GetPAndSInfo( TAny* aHandle, TMemSpyDriverPAndSInfo& aInfo ); |
346 public: // CLIENT <-> SERVER |
371 public: // CLIENT <-> SERVER |
347 |
372 |
348 /** |
373 /** |
349 * Gets handles of all sessions that are connected to a particular server |
374 * Gets handles of all sessions that are connected to a particular server |
350 */ |
375 */ |
351 IMPORT_C TInt GetServerSessionHandles( TAny* aServerHandle, TAny** aSessionHandleArray, TInt& aSessionHandleCount ); |
376 IMPORT_C TInt GetServerSessionHandles( TAny* aServerHandle, TAny** aSessionHandleArray, TInt& aSessionHandleCount ); |
352 |
377 |
353 /** |
378 /** |
354 * Gets session information for a given session handle. |
379 * Gets session information for a given session handle. |
355 */ |
380 */ |
356 IMPORT_C TInt GetServerSessionInfo( TAny* aSessionHandle, TMemSpyDriverServerSessionInfo& aParams ); |
381 IMPORT_C TInt GetServerSessionInfo( TAny* aSessionHandle, TMemSpyDriverServerSessionInfo& aParams ); |