Update contrib.
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Purpose: Kernel-side tracking of process state
18 #ifndef D_PROCESS_TRACKER_H
19 #define D_PROCESS_TRACKER_H
21 #include "d_target_process.h"
23 // The global class which tracks all debugged processes.
25 // Note that multiple debug agents may attach to a process,
26 // as the security server will ensure only one is an 'active'
27 // agent, preventing conflicts. Other agents will be 'passive',
28 // typically interested only in recording events.
30 // The above requirement generates the requirement for the class
31 // to track the agent IDs, as multiple debug agents may be interested
34 class DProcessTracker : public DBase
40 TInt AttachProcess(const TDesC8& aProcessName, TUint64 aAgentId);
42 TInt DetachProcess(const TDesC8& aProcessName, TUint64 aAgentId);
44 TInt DetachAgent(TUint64 aAgentId);
46 DTargetProcess* FindProcess(const TDesC8& aProcessName);
48 DTargetProcess* FuzzyFindProcess(const TDesC8& aProcessName);
50 TBool CheckSuspended(const TUint64 aTargetThreadId) const;
51 TBool CheckSuspended(DThread* aTargetThread) const;
52 TInt SuspendThread(DThread* aTargetThread, TBool aFreezeThread=EFalse);
53 TInt ResumeThread(DThread* aTargetThread);
57 TInt RemoveSuspendedThread(DThread* aThread);
58 TInt AddSuspendedThread(DThread* aThread);
59 HBuf* GetFileName(DThread* aThread) const;
62 RPointerArray<DTargetProcess> iProcesses;
65 // static global object
66 extern DProcessTracker TheDProcessTracker;
68 #endif // D_PROCESS_TRACKER_H