|
0
|
1 |
/*
|
|
|
2 |
* Copyright (c) 2004 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 |
|
|
|
19 |
/** Event handler and container for all objects being tracked. */
|
|
|
20 |
#ifndef __TRKEVENTHANDLER_H__
|
|
|
21 |
#define __TRKEVENTHANDLER_H__
|
|
|
22 |
|
|
|
23 |
|
|
|
24 |
class DMetroTrkEventHandler : public DKernelEventHandler
|
|
|
25 |
{
|
|
|
26 |
public:
|
|
|
27 |
DMetroTrkEventHandler();
|
|
|
28 |
TInt Create(DLogicalDevice* aDevice, DLogicalChannel* aChannel, DThread* aClient);
|
|
|
29 |
~DMetroTrkEventHandler();
|
|
|
30 |
TInt Start();
|
|
|
31 |
TInt Stop();
|
|
|
32 |
|
|
|
33 |
private:
|
|
|
34 |
static TUint EventHandler(TKernelEvent aEvent, TAny* a1, TAny* a2, TAny* aThis);
|
|
|
35 |
TUint HandleEvent(TKernelEvent aType, TAny* a1, TAny* a2);
|
|
|
36 |
|
|
|
37 |
TBool HandleEventKillThread(DThread* a1);
|
|
|
38 |
TBool HandleSwException(TExcType aExcType);
|
|
|
39 |
TBool HandleHwException(TArmExcInfo* aExcInfo);
|
|
|
40 |
TBool HandleUserTrace(TText* aStr, TInt aLen);
|
|
|
41 |
|
|
|
42 |
void AddProcess(DProcess *aProcess, DThread *aThread);
|
|
|
43 |
void StartThread(DThread *aThread);
|
|
|
44 |
void RemoveProcess(DProcess *aProcess);
|
|
|
45 |
void AddLibrary(DLibrary *aLibrary, DThread *aThread);
|
|
|
46 |
void RemoveLibrary(DLibrary *aLibrary);
|
|
|
47 |
void AddCodeSegment(DCodeSeg *aCodeSeg, DProcess *aProcess);
|
|
|
48 |
void RemoveCodeSegment(DCodeSeg *aCodeSeg, DProcess *aProcess);
|
|
|
49 |
|
|
|
50 |
private:
|
|
|
51 |
/** Lock serialising calls to event handler */
|
|
|
52 |
DSemaphore* iLock;
|
|
|
53 |
TBool iTracking;
|
|
|
54 |
/** Tracking list (of TTrackedObject).
|
|
|
55 |
Must be accessed only when tracking is disabled or with iLock held.
|
|
|
56 |
Object addresses are used as keys and so must be unique.
|
|
|
57 |
*/
|
|
|
58 |
TInt iOOM;
|
|
|
59 |
TInt iErrorCount;
|
|
|
60 |
TInt iCounters[EEventLimit];
|
|
|
61 |
|
|
|
62 |
DLogicalDevice* iDevice; // open reference to LDD for avoiding lifetime issues
|
|
|
63 |
DThread* iClientThread;
|
|
|
64 |
DLogicalChannel* iChannel;
|
|
|
65 |
};
|
|
|
66 |
|
|
|
67 |
#endif //__TRKEVENTHANDLER_H__
|