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 ENGINEWRAPPER_H_
|
|
19 |
#define ENGINEWRAPPER_H_
|
|
20 |
|
|
21 |
#include <QObject>
|
|
22 |
#include <QVariantList>
|
|
23 |
#include <QSettings>
|
|
24 |
|
|
25 |
#include <memspysession.h>
|
|
26 |
|
|
27 |
typedef quint64 ProcessId;
|
|
28 |
typedef quint64 ThreadId;
|
|
29 |
|
|
30 |
enum ThreadPriority
|
|
31 |
{
|
|
32 |
ThreadPriorityNull=(-30),
|
|
33 |
ThreadPriorityMuchLess=(-20),
|
|
34 |
ThreadPriorityLess=(-10),
|
|
35 |
ThreadPriorityNormal=0,
|
|
36 |
ThreadPriorityMore=10,
|
|
37 |
ThreadPriorityMuchMore=20,
|
|
38 |
ThreadPriorityRealTime=30,
|
|
39 |
ThreadPriorityAbsoluteVeryLow=100,
|
|
40 |
ThreadPriorityAbsoluteLowNormal=150,
|
|
41 |
ThreadPriorityAbsoluteLow=200,
|
|
42 |
ThreadPriorityAbsoluteBackgroundNormal=250,
|
|
43 |
ThreadPriorityAbsoluteBackground=300,
|
|
44 |
ThreadPriorityAbsoluteForegroundNormal=350,
|
|
45 |
ThreadPriorityAbsoluteForeground=400,
|
|
46 |
ThreadPriorityAbsoluteHighNormal=450,
|
|
47 |
ThreadPriorityAbsoluteHigh=500,
|
|
48 |
ThreadPriorityAbsoluteRealTime1=810,
|
|
49 |
ThreadPriorityAbsoluteRealTime2=820,
|
|
50 |
ThreadPriorityAbsoluteRealTime3=830,
|
|
51 |
ThreadPriorityAbsoluteRealTime4=840,
|
|
52 |
ThreadPriorityAbsoluteRealTime5=850,
|
|
53 |
ThreadPriorityAbsoluteRealTime6=860,
|
|
54 |
ThreadPriorityAbsoluteRealTime7=870,
|
|
55 |
ThreadPriorityAbsoluteRealTime8=880
|
|
56 |
};
|
|
57 |
|
|
58 |
enum KernelObjectType
|
|
59 |
{
|
|
60 |
KernelObjectTypeUnknown = -1,
|
|
61 |
KernelObjectTypeThread = 0,
|
|
62 |
KernelObjectTypeProcess,
|
|
63 |
KernelObjectTypeChunk,
|
|
64 |
KernelObjectTypeLibrary,
|
|
65 |
KernelObjectTypeSemaphore,
|
|
66 |
KernelObjectTypeMutex,
|
|
67 |
KernelObjectTypeTimer,
|
|
68 |
KernelObjectTypeServer,
|
|
69 |
KernelObjectTypeSession,
|
|
70 |
KernelObjectTypeLogicalDevice,
|
|
71 |
KernelObjectTypePhysicalDevice,
|
|
72 |
KernelObjectTypeLogicalChannel,
|
|
73 |
KernelObjectTypeChangeNotifier,
|
|
74 |
KernelObjectTypeUndertaker,
|
|
75 |
KernelObjectTypeMsgQueue,
|
|
76 |
KernelObjectTypePropertyRef,
|
|
77 |
KernelObjectTypeCondVar
|
|
78 |
};
|
|
79 |
|
|
80 |
enum ThreadInfoType
|
|
81 |
{
|
|
82 |
ThreadInfoTypeGeneral = EMemSpyThreadInfoItemTypeGeneralInfo,
|
|
83 |
ThreadInfoTypeHeap = EMemSpyThreadInfoItemTypeHeap,
|
|
84 |
ThreadInfoTypeStack = EMemSpyThreadInfoItemTypeStack,
|
|
85 |
ThreadInfoTypeChunk = EMemSpyThreadInfoItemTypeChunk,
|
|
86 |
ThreadInfoTypeCodeSeg = EMemSpyThreadInfoItemTypeCodeSeg,
|
|
87 |
ThreadInfoTypeOpenFiles = EMemSpyThreadInfoItemTypeOpenFiles,
|
|
88 |
ThreadInfoTypeActiveObjects = EMemSpyThreadInfoItemTypeActiveObject,
|
|
89 |
ThreadInfoTypeOwnedThreadHandles = EMemSpyThreadInfoItemTypeOwnedThreadHandles,
|
|
90 |
ThreadInfoTypeOwnedProcessHandles = EMemSpyThreadInfoItemTypeOwnedProcessHandles,
|
|
91 |
ThreadInfoTypeServer = EMemSpyThreadInfoItemTypeServer,
|
|
92 |
ThreadInfoTypeSession = EMemSpyThreadInfoItemTypeSession,
|
|
93 |
ThreadInfoTypeSemaphore = EMemSpyThreadInfoItemTypeSemaphore,
|
|
94 |
ThreadInfoTypeOtherThreads = EMemSpyThreadInfoItemTypeOtherThreads,
|
|
95 |
ThreadInfoTypeOtherProcesses = EMemSpyThreadInfoItemTypeOtherProcesses,
|
|
96 |
ThreadInfoTypeMutex = EMemSpyThreadInfoItemTypeMutex,
|
|
97 |
ThreadInfoTypeTimer = EMemSpyThreadInfoItemTypeTimer,
|
|
98 |
ThreadInfoTypeChannel = EMemSpyThreadInfoItemTypeLogicalChannel,
|
|
99 |
ThreadInfoTypeChangeNotifier = EMemSpyThreadInfoItemTypeChangeNotifier,
|
|
100 |
ThreadInfoTypeUndertaker = EMemSpyThreadInfoItemTypeUndertaker,
|
|
101 |
ThreadInfoTypeMessageQueue = EMemSpyThreadInfoItemTypeMessageQueue,
|
|
102 |
ThreadInfoTypeConditionalVariable = EMemSpyThreadInfoItemTypeConditionalVariable,
|
|
103 |
ThreadInfoTypeLDD = EMemSpyThreadInfoItemTypeLDD,
|
|
104 |
ThreadInfoTypePDD = EMemSpyThreadInfoItemTypePDD,
|
|
105 |
};
|
|
106 |
|
|
107 |
enum DeviceWideOperation
|
|
108 |
{
|
|
109 |
OutputPhoneInfo = 0,
|
|
110 |
|
|
111 |
OutputDetailedPhoneInfo,
|
|
112 |
|
|
113 |
OutputHeapInfo,
|
|
114 |
|
|
115 |
OutputCompactHeapInfo,
|
|
116 |
|
|
117 |
OutputHeapCellListing,
|
|
118 |
|
|
119 |
OutputHeapData,
|
|
120 |
|
|
121 |
OutputStackInfo,
|
|
122 |
|
|
123 |
OutputCompactStackInfo,
|
|
124 |
|
|
125 |
OutputUserStackData,
|
|
126 |
|
|
127 |
OutputKernelStackData
|
|
128 |
};
|
|
129 |
|
|
130 |
enum SwmtMode
|
|
131 |
{
|
|
132 |
SwmtModeBasic = 0,
|
|
133 |
SwmtModeFull,
|
|
134 |
SwmtModeCustom
|
|
135 |
};
|
|
136 |
|
|
137 |
enum HeapDumpsMode
|
|
138 |
{
|
|
139 |
HeapDumpsModeKernel = 0,
|
|
140 |
HeapDumpsModeUser,
|
|
141 |
HeapDumpsModeBoth
|
|
142 |
};
|
|
143 |
|
|
144 |
enum OutputMode
|
|
145 |
{
|
|
146 |
OutputModeTrace = 0,
|
|
147 |
OutputModeFile
|
|
148 |
};
|
|
149 |
|
|
150 |
class MemSpyProcess
|
|
151 |
{
|
|
152 |
public:
|
|
153 |
MemSpyProcess(CMemSpyApiProcess* process)
|
|
154 |
: mProcess(process)
|
|
155 |
{}
|
|
156 |
|
|
157 |
virtual ~MemSpyProcess() { delete mProcess; }
|
|
158 |
|
|
159 |
ProcessId id() const { return mProcess->Id(); }
|
|
160 |
|
|
161 |
QString name() const { return QString((QChar*) mProcess->Name().Ptr(), mProcess->Name().Length()); }
|
|
162 |
|
|
163 |
QString exitInfo() const;
|
|
164 |
|
|
165 |
int priority() const { return mProcess->Priority(); }
|
|
166 |
|
|
167 |
int threadCount() const { return mProcess->ThreadCount(); }
|
|
168 |
|
|
169 |
int sid() const { return mProcess->SID(); }
|
|
170 |
|
|
171 |
int vid() const { return mProcess->VID(); }
|
|
172 |
|
|
173 |
bool isDead() const { return mProcess->IsDead(); }
|
|
174 |
|
|
175 |
private:
|
|
176 |
CMemSpyApiProcess *mProcess;
|
|
177 |
};
|
|
178 |
|
|
179 |
class MemSpyThread
|
|
180 |
{
|
|
181 |
public:
|
|
182 |
MemSpyThread(CMemSpyApiThread* thread)
|
|
183 |
: mThread(thread)
|
|
184 |
{}
|
|
185 |
|
|
186 |
virtual ~MemSpyThread() { delete mThread; }
|
|
187 |
|
|
188 |
ThreadId id() const { return mThread->Id(); }
|
|
189 |
|
|
190 |
QString name() const { return QString((QChar*) mThread->Name().Ptr(), mThread->Name().Length()); }
|
|
191 |
|
|
192 |
int priority() const { return mThread->ThreadPriority(); }
|
|
193 |
|
|
194 |
|
|
195 |
private:
|
|
196 |
CMemSpyApiThread *mThread;
|
|
197 |
};
|
|
198 |
|
|
199 |
class MemSpyKernelObjectType
|
|
200 |
{
|
|
201 |
public:
|
|
202 |
MemSpyKernelObjectType(CMemSpyApiKernelObject* type)
|
|
203 |
: mType(type)
|
|
204 |
{}
|
|
205 |
|
|
206 |
virtual ~MemSpyKernelObjectType() { delete mType; }
|
|
207 |
|
|
208 |
int id() const { return mType->Type(); }
|
|
209 |
|
|
210 |
QString name() const { return QString((QChar*) mType->Name().Ptr(), mType->Name().Length()); }
|
|
211 |
|
|
212 |
int count() const { return mType->Count(); }
|
|
213 |
|
|
214 |
qint64 size() const { return mType->Size(); }
|
|
215 |
|
|
216 |
private:
|
|
217 |
CMemSpyApiKernelObject *mType;
|
|
218 |
};
|
|
219 |
|
|
220 |
class MemSpyKernelObject
|
|
221 |
{
|
|
222 |
public:
|
|
223 |
MemSpyKernelObject(CMemSpyApiKernelObjectItem* object)
|
|
224 |
: mObject(object)
|
|
225 |
{}
|
|
226 |
|
|
227 |
virtual ~MemSpyKernelObject() { delete mObject; }
|
|
228 |
|
|
229 |
int type() const { return mObject->Type(); }
|
|
230 |
|
|
231 |
QString name() const { return QString::fromLatin1((char*)mObject->Name().Ptr(), mObject->Name().Length()); }
|
|
232 |
|
|
233 |
QString nameDetail() const { return QString::fromLatin1((char*)mObject->NameDetail().Ptr(), mObject->NameDetail().Length()); }
|
|
234 |
|
|
235 |
int accessCount() const { return mObject->AccessCount(); }
|
|
236 |
|
|
237 |
int uniqueId() const { return mObject->UniqueID(); }
|
|
238 |
|
|
239 |
unsigned int protection() const { return mObject->Protection(); }
|
|
240 |
|
|
241 |
unsigned int addressOfKernelOwner() const { return reinterpret_cast<unsigned int>(mObject->AddressOfKernelOwner()); }
|
|
242 |
|
|
243 |
unsigned int kernelAddress() const { return reinterpret_cast<unsigned int>(mObject->Handle()); }
|
|
244 |
|
|
245 |
unsigned int addressOfOwningProcess() const { return reinterpret_cast<unsigned int>(mObject->AddressOfOwningProcess()); }
|
|
246 |
|
|
247 |
int id() const { return mObject->Id(); }
|
|
248 |
|
|
249 |
int priority() const { return mObject->Priority(); }
|
|
250 |
|
|
251 |
QString nameOfOwner() const { return QString::fromLatin1((char*)mObject->NameOfOwner().Ptr(), mObject->NameOfOwner().Length()); }
|
|
252 |
|
|
253 |
unsigned int creatorId() const { return mObject->CreatorId(); }
|
|
254 |
|
|
255 |
int attributes() const { return mObject->Attributes(); }
|
|
256 |
|
|
257 |
unsigned int addressOfDataBssStackChunk() const { return reinterpret_cast<unsigned int>(mObject->AddressOfDataBssStackChunk()); }
|
|
258 |
|
|
259 |
unsigned int securityZone() const { return mObject->SecurityZone(); }
|
|
260 |
|
|
261 |
unsigned int size() const { return mObject->Size(); }
|
|
262 |
|
|
263 |
unsigned int maxSize() const { return mObject->MaxSize(); }
|
|
264 |
|
|
265 |
unsigned int bottom() const { return mObject->Bottom(); }
|
|
266 |
|
|
267 |
unsigned int top() const { return mObject->Top(); }
|
|
268 |
|
|
269 |
unsigned int startPos() const { return mObject->StartPos(); }
|
|
270 |
|
|
271 |
unsigned int controllingOwner() const { return mObject->ControllingOwner(); }
|
|
272 |
|
|
273 |
unsigned int restrictions() const { return mObject->Restrictions(); }
|
|
274 |
|
|
275 |
unsigned int mapAttr() const { return mObject->Restrictions(); }
|
|
276 |
|
|
277 |
unsigned int chunkType() const { return mObject->ChunkType(); }
|
|
278 |
|
|
279 |
int mapCount() const { return mObject->MapCount(); }
|
|
280 |
|
|
281 |
unsigned int state() const { return mObject->State(); }
|
|
282 |
|
|
283 |
unsigned int addressOfCodeSeg() const { return reinterpret_cast<unsigned int>(mObject->AddressOfCodeSeg()); }
|
|
284 |
|
|
285 |
unsigned int resetting() const { return mObject->Resetting(); }
|
|
286 |
|
|
287 |
unsigned int order() const { return mObject->Order(); }
|
|
288 |
|
|
289 |
QString version() const { return QString((QChar*) mObject->Version().Name().Ptr(), mObject->Version().Name().Length()); }
|
|
290 |
|
|
291 |
unsigned int parseMask() const { return mObject->ParseMask(); }
|
|
292 |
|
|
293 |
unsigned int unitsMask() const { return mObject->UnitsMask(); }
|
|
294 |
|
|
295 |
unsigned int changes() const { return mObject->Changes(); }
|
|
296 |
|
|
297 |
int count() const { return mObject->Count(); }
|
|
298 |
|
|
299 |
int waitCount() const { return mObject->WaitCount(); }
|
|
300 |
|
|
301 |
int sessionType() const { return mObject->SessionType(); }
|
|
302 |
|
|
303 |
int timerType() const { return mObject->TimerType(); }
|
|
304 |
|
|
305 |
int timerState() const { return mObject->TimerState(); }
|
|
306 |
|
|
307 |
unsigned int addressOfOwningThread() const { return reinterpret_cast<unsigned int>(mObject->AddressOfOwningThread()); }
|
|
308 |
|
|
309 |
unsigned int addressOfServer() const { return reinterpret_cast<unsigned int>(mObject->AddressOfServer()); }
|
|
310 |
|
|
311 |
unsigned int svrSessionType() const { return mObject->SvrSessionType(); }
|
|
312 |
|
|
313 |
int msgCount() const { return mObject->MsgCount(); }
|
|
314 |
|
|
315 |
int msgLimit() const { return mObject->MsgLimit(); }
|
|
316 |
|
|
317 |
unsigned int totalAccessCount() const { return mObject->TotalAccessCount(); }
|
|
318 |
|
|
319 |
int openChannels() const { return mObject->OpenChannels(); }
|
|
320 |
|
|
321 |
private:
|
|
322 |
CMemSpyApiKernelObjectItem *mObject;
|
|
323 |
};
|
|
324 |
|
|
325 |
class MemSpyThreadInfoItem
|
|
326 |
{
|
|
327 |
public:
|
|
328 |
MemSpyThreadInfoItem(CMemSpyApiThreadInfoItem *item)
|
|
329 |
: mItem(item)
|
|
330 |
{}
|
|
331 |
|
|
332 |
virtual ~MemSpyThreadInfoItem() { delete mItem; }
|
|
333 |
|
|
334 |
QString caption() const { return QString((QChar*) mItem->Caption().Ptr(), mItem->Caption().Length()); }
|
|
335 |
|
|
336 |
QString value() const { return QString((QChar*) mItem->Value().Ptr(), mItem->Value().Length()); }
|
|
337 |
|
|
338 |
private:
|
|
339 |
CMemSpyApiThreadInfoItem* mItem;
|
|
340 |
};
|
|
341 |
|
|
342 |
class MemSpyServer
|
|
343 |
{
|
|
344 |
public:
|
|
345 |
MemSpyServer(CMemSpyApiServer* server)
|
|
346 |
: mServer(server)
|
|
347 |
{}
|
|
348 |
|
|
349 |
virtual ~MemSpyServer() { delete mServer; }
|
|
350 |
|
|
351 |
ProcessId id() const { return mServer->Id(); }
|
|
352 |
|
|
353 |
QString name() const { return QString((QChar*) mServer->Name().Ptr(), mServer->Name().Length()); }
|
|
354 |
|
|
355 |
int sessionCount() const { return mServer->SessionCount(); }
|
|
356 |
|
|
357 |
private:
|
|
358 |
CMemSpyApiServer *mServer;
|
|
359 |
};
|
|
360 |
|
|
361 |
class MemSpyEComCategory
|
|
362 |
{
|
|
363 |
public:
|
|
364 |
MemSpyEComCategory(CMemSpyApiEComCategory* category)
|
|
365 |
: mData(category)
|
|
366 |
{}
|
|
367 |
|
|
368 |
virtual ~MemSpyEComCategory() { delete mData; }
|
|
369 |
|
|
370 |
int id() const { return mData->Id().iUid; }
|
|
371 |
|
|
372 |
QString name() const { return QString((QChar*) mData->Name().Ptr(), mData->Name().Length()); }
|
|
373 |
|
|
374 |
int interfaceCount() const { return mData->InterfaceCount(); }
|
|
375 |
|
|
376 |
private:
|
|
377 |
CMemSpyApiEComCategory *mData;
|
|
378 |
};
|
|
379 |
|
|
380 |
class MemSpyEComInterface
|
|
381 |
{
|
|
382 |
public:
|
|
383 |
MemSpyEComInterface(CMemSpyApiEComInterface* interface)
|
|
384 |
: mData(interface)
|
|
385 |
{}
|
|
386 |
|
|
387 |
virtual ~MemSpyEComInterface() { delete mData; }
|
|
388 |
|
|
389 |
int id() const { return mData->Id().iUid; }
|
|
390 |
|
|
391 |
int categoryId() const { return mData->CategoryId().iUid; }
|
|
392 |
|
|
393 |
QString name() const { return QString((QChar*) mData->Name().Ptr(), mData->Name().Length()); }
|
|
394 |
|
|
395 |
int implementationCount() const { return mData->ImplementationCount(); }
|
|
396 |
|
|
397 |
private:
|
|
398 |
CMemSpyApiEComInterface *mData;
|
|
399 |
};
|
|
400 |
|
|
401 |
class MemSpyEComImplementation
|
|
402 |
{
|
|
403 |
public:
|
|
404 |
MemSpyEComImplementation(CMemSpyApiEComImplementation* interface)
|
|
405 |
: mData(interface)
|
|
406 |
{}
|
|
407 |
|
|
408 |
virtual ~MemSpyEComImplementation() { delete mData; }
|
|
409 |
|
|
410 |
int id() const { return mData->ImplementationUid().iUid; }
|
|
411 |
|
|
412 |
QString name() const { return QString((QChar*) mData->Name().Ptr(), mData->Name().Length()); }
|
|
413 |
|
|
414 |
int version() const { return mData->Version(); }
|
|
415 |
|
|
416 |
QString dataType() const { return QString((QChar*) mData->DataType().Ptr(), mData->DataType().Length()); }
|
|
417 |
|
|
418 |
QString opaqueData() const { return QString((QChar*) mData->OpaqueData().Ptr(), mData->OpaqueData().Length()); }
|
|
419 |
|
|
420 |
QString drive() const { return QString((QChar*) mData->Drive().Name().Ptr(), mData->Drive().Name().Length()); }
|
|
421 |
|
|
422 |
bool romOnly() const { return mData->RomOnly(); }
|
|
423 |
|
|
424 |
bool romBased() const { return mData->RomBased(); }
|
|
425 |
|
|
426 |
int vendorId() const { return mData->VendorId(); }
|
|
427 |
|
|
428 |
bool disabled() const { return mData->Disabled(); }
|
|
429 |
|
|
430 |
private:
|
|
431 |
CMemSpyApiEComImplementation *mData;
|
|
432 |
};
|
|
433 |
|
|
434 |
|
|
435 |
class MemSpyDwoProgressTracker : public QObject, public CActive
|
|
436 |
{
|
|
437 |
Q_OBJECT
|
|
438 |
|
|
439 |
public:
|
|
440 |
MemSpyDwoProgressTracker(RMemSpySession &session);
|
|
441 |
virtual ~MemSpyDwoProgressTracker();
|
|
442 |
|
|
443 |
public slots:
|
|
444 |
|
|
445 |
void start();
|
|
446 |
|
|
447 |
void cancel();
|
|
448 |
|
|
449 |
protected: // from CActive
|
|
450 |
|
|
451 |
virtual void RunL();
|
|
452 |
|
|
453 |
virtual void DoCancel();
|
|
454 |
|
|
455 |
virtual TInt RunError(TInt aError);
|
|
456 |
|
|
457 |
signals:
|
|
458 |
void progress(int progress, const QString& processName);
|
|
459 |
|
|
460 |
private:
|
|
461 |
TMemSpyDeviceWideOperationProgress mProgress;
|
|
462 |
RMemSpySession mSession;
|
|
463 |
};
|
|
464 |
|
|
465 |
class MemSpyDwoTracker : public QObject, public CActive
|
|
466 |
{
|
|
467 |
Q_OBJECT
|
|
468 |
|
|
469 |
public:
|
|
470 |
MemSpyDwoTracker(RMemSpySession &session, DeviceWideOperation operation);
|
|
471 |
virtual ~MemSpyDwoTracker();
|
|
472 |
|
|
473 |
public slots:
|
|
474 |
|
|
475 |
void start();
|
|
476 |
|
|
477 |
void cancel();
|
|
478 |
|
|
479 |
protected: // from CActive
|
|
480 |
|
|
481 |
virtual void RunL();
|
|
482 |
|
|
483 |
virtual void DoCancel();
|
|
484 |
|
|
485 |
virtual TInt RunError(TInt aError);
|
|
486 |
|
|
487 |
signals:
|
|
488 |
void finished(int errorCode);
|
|
489 |
void progress(int progress, const QString& processName);
|
|
490 |
|
|
491 |
private:
|
|
492 |
RMemSpySession mSession;
|
|
493 |
MemSpyDwoProgressTracker *mProgressTracker;
|
|
494 |
DeviceWideOperation mOperation;
|
|
495 |
};
|
|
496 |
|
|
497 |
class MemSpyAsyncTracker : public QObject, public CActive
|
|
498 |
{
|
|
499 |
Q_OBJECT
|
|
500 |
|
|
501 |
public:
|
|
502 |
|
|
503 |
MemSpyAsyncTracker(RMemSpySession& session, void (RMemSpySession::*function)(TRequestStatus&));
|
|
504 |
|
|
505 |
void start();
|
|
506 |
|
|
507 |
virtual void RunL();
|
|
508 |
|
|
509 |
virtual void DoCancel();
|
|
510 |
|
|
511 |
virtual TInt RunError(TInt aError);
|
|
512 |
|
|
513 |
signals:
|
|
514 |
|
|
515 |
void finished(int errorCode);
|
|
516 |
|
|
517 |
private:
|
|
518 |
void (RMemSpySession::*mFunction)(TRequestStatus&);
|
|
519 |
RMemSpySession& mSession;
|
|
520 |
};
|
|
521 |
|
|
522 |
class MemSpySwmtDumpTracker : public MemSpyAsyncTracker
|
|
523 |
{
|
|
524 |
public:
|
|
525 |
MemSpySwmtDumpTracker(RMemSpySession& session) :
|
|
526 |
MemSpyAsyncTracker(session, &RMemSpySession::ForceSwmtUpdate)
|
|
527 |
{}
|
|
528 |
};
|
|
529 |
|
|
530 |
class MemSpyKernelHeapDumpTracker : public MemSpyAsyncTracker
|
|
531 |
{
|
|
532 |
public:
|
|
533 |
MemSpyKernelHeapDumpTracker(RMemSpySession& session) :
|
|
534 |
MemSpyAsyncTracker(session, &RMemSpySession::OutputKernelHeapData)
|
|
535 |
{}
|
|
536 |
};
|
|
537 |
|
|
538 |
class MemSpySettings : private QSettings
|
|
539 |
{
|
|
540 |
public:
|
|
541 |
|
|
542 |
MemSpySettings();
|
|
543 |
|
|
544 |
OutputMode outputMode() const;
|
|
545 |
void setOutputMode(OutputMode mode);
|
|
546 |
|
|
547 |
QString outputPath() const;
|
|
548 |
void setOutputPath(const QString& path);
|
|
549 |
|
|
550 |
int swmtTimerPeriod() const;
|
|
551 |
void setSwmtTimerPeriod(int period);
|
|
552 |
|
|
553 |
SwmtMode swmtMode() const;
|
|
554 |
void setSwmtMode(SwmtMode mode);
|
|
555 |
|
|
556 |
QVariantList swmtCategories() const;
|
|
557 |
void setSwmtCategories(const QVariantList& categories);
|
|
558 |
|
|
559 |
HeapDumpsMode heapDumpsMode() const;
|
|
560 |
void setHeapDumpsMode(HeapDumpsMode mode);
|
|
561 |
};
|
|
562 |
|
|
563 |
class EngineWrapper : public QObject
|
|
564 |
{
|
|
565 |
Q_OBJECT
|
|
566 |
|
|
567 |
public:
|
|
568 |
EngineWrapper();
|
|
569 |
|
|
570 |
virtual ~EngineWrapper();
|
|
571 |
|
|
572 |
bool initialize();
|
|
573 |
|
|
574 |
MemSpySettings& settings();
|
|
575 |
|
|
576 |
const MemSpySettings& settings() const;
|
|
577 |
|
|
578 |
|
|
579 |
|
|
580 |
QList<MemSpyProcess*> getProcesses();
|
|
581 |
|
|
582 |
QList<MemSpyThread*> getThreads(ProcessId processId);
|
|
583 |
|
|
584 |
QList<MemSpyThreadInfoItem*> getThreadInfo(ThreadId threadId, ThreadInfoType type);
|
|
585 |
|
|
586 |
void setThreadPriority(ThreadId threadId, ThreadPriority priority);
|
|
587 |
|
|
588 |
QList<MemSpyKernelObjectType*> getKernelObjectTypes();
|
|
589 |
|
|
590 |
QList<MemSpyKernelObject*> getKernelObjects(int type);
|
|
591 |
|
|
592 |
QList<MemSpyServer*> getServers();
|
|
593 |
|
|
594 |
QList<MemSpyEComCategory*> getEComCategories();
|
|
595 |
|
|
596 |
QList<MemSpyEComInterface*> getEComInterfaces(int categoryId);
|
|
597 |
|
|
598 |
QList<MemSpyEComImplementation*> getEComImplementations(int interfaceId);
|
|
599 |
|
|
600 |
MemSpyDwoTracker* createDeviceWideOperation(DeviceWideOperation operation);
|
|
601 |
|
|
602 |
MemSpyKernelHeapDumpTracker* createKernelHeapDumpTracker();
|
|
603 |
|
|
604 |
MemSpySwmtDumpTracker* createSwmtDumpTracker();
|
|
605 |
|
|
606 |
void setSwmtSettings(SwmtMode mode, const QVariantList& categories);
|
|
607 |
|
|
608 |
bool isSwmtRunning();
|
|
609 |
|
|
610 |
void startSwmt(int period);
|
|
611 |
|
|
612 |
void stopSwmt();
|
|
613 |
|
|
614 |
void forceSwmtDump();
|
|
615 |
|
|
616 |
void outputKernelHeapData();
|
|
617 |
|
|
618 |
int outputThreadHeapData(const QString& filter);
|
|
619 |
|
|
620 |
void updateOutputSettings();
|
|
621 |
|
|
622 |
void killProcess(ProcessId process);
|
|
623 |
|
|
624 |
void panicProcess(ProcessId process);
|
|
625 |
|
|
626 |
void terminateProcess(ProcessId process);
|
|
627 |
|
|
628 |
private:
|
|
629 |
RMemSpySession mSession;
|
|
630 |
|
|
631 |
bool mSwmtRunning;
|
|
632 |
|
|
633 |
MemSpySettings mSettings;
|
|
634 |
};
|
|
635 |
|
|
636 |
#endif /* ENGINEWRAPPER_H_ */
|