os/kernelhwsrv/kernel/eka/drivers/debug/rmdebug/d_target_process.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // Purpose: Kernel-side tracking of process state
    15 // 
    16 //
    17  
    18 #ifndef D_TARGET_PROCESS_H
    19 #define D_TARGET_PROCESS_H
    20 
    21 #include "d_debug_agent.h"
    22 
    23 // Debug Process Tracker class
    24 class DTargetProcess : public DBase
    25 {
    26 public:
    27 	DTargetProcess();
    28 	~DTargetProcess();
    29 
    30 	static TInt Compare(const DTargetProcess& aFirst, const DTargetProcess& aSecond);
    31 
    32 	TInt SetProcessName(const TDesC8& aProcessName);
    33 
    34 	const TPtr8& ProcessName(void);
    35 
    36 	TInt AddAgent(const TUint64 aAgentId);
    37 
    38 	TInt RemoveAgent(TUint64 aAgentId);
    39 
    40 	DDebugAgent* operator[](TInt aIndex);
    41 
    42 	DDebugAgent* Agent(TUint64 aAgentId);
    43 
    44 	TInt AgentCount(void);
    45 	TInt ResumeThread(DThread* aThread);
    46 	TInt SuspendThread(DThread* aThread, TBool aFreezeThread=EFalse);
    47 	TBool CheckSuspended(DThread* aThread) const;
    48 	void FSWait();
    49 	TBool HasSuspendedThreads() const;
    50 	void NotifyEvent(const TDriverEventInfo& aEventInfo);
    51 
    52 private:
    53 	TInt ResumeFrozenThread(NThread& aThread);
    54 	TInt ResumeSuspendedThread(DThread* aThread);
    55 	TInt FreezeThread();
    56 	TInt DoSuspendThread(DThread* aThread);
    57 
    58 private:
    59 	TPtr8 iProcessName;
    60 
    61 	RPointerArray<DDebugAgent> iAgentList;
    62 
    63 	RArray<TUint64> iSuspendedThreads;
    64 
    65 	RPointerArray<NFastSemaphore> iFrozenThreadSemaphores;
    66 
    67 };
    68 
    69 #endif // D_TARGET_PROCESS_H
    70