sl@0
|
1 |
// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
// Purpose: Kernel-side tracking of debug agent information associated
|
sl@0
|
15 |
// with each process being debugged.
|
sl@0
|
16 |
//
|
sl@0
|
17 |
//
|
sl@0
|
18 |
|
sl@0
|
19 |
#ifndef D_DEBUG_AGENT_H
|
sl@0
|
20 |
#define D_DEBUG_AGENT_H
|
sl@0
|
21 |
|
sl@0
|
22 |
#include <rm_debug_api.h>
|
sl@0
|
23 |
#include "d_driver_event_info.h"
|
sl@0
|
24 |
|
sl@0
|
25 |
class DDebugAgent : public DBase
|
sl@0
|
26 |
{
|
sl@0
|
27 |
public:
|
sl@0
|
28 |
static DDebugAgent* New(TUint64);
|
sl@0
|
29 |
~DDebugAgent();
|
sl@0
|
30 |
|
sl@0
|
31 |
TInt SetEventAction(Debug::TEventType aEvent, Debug::TKernelEventAction aEventAction);
|
sl@0
|
32 |
void GetEvent(TClientDataRequest<Debug::TEventInfo>* aAsyncGetValueRequest, Debug::TEventInfo* aEventInfo, DThread* aClientThread);
|
sl@0
|
33 |
TInt EventAction(Debug::TEventType aEvent);
|
sl@0
|
34 |
|
sl@0
|
35 |
TInt CancelGetEvent(void);
|
sl@0
|
36 |
void NotifyEvent(const TDriverEventInfo& aEventInfo);
|
sl@0
|
37 |
TUint64 Id();
|
sl@0
|
38 |
|
sl@0
|
39 |
protected:
|
sl@0
|
40 |
DDebugAgent(TUint64 aId);
|
sl@0
|
41 |
TInt Construct();
|
sl@0
|
42 |
|
sl@0
|
43 |
private:
|
sl@0
|
44 |
void QueueEvent(TDriverEventInfo& aEventInfo);
|
sl@0
|
45 |
TBool BufferEmpty() const;
|
sl@0
|
46 |
TBool BufferFull() const;
|
sl@0
|
47 |
TBool BufferCanStoreEvent() const;
|
sl@0
|
48 |
TBool BufferAtCriticalLevel() const;
|
sl@0
|
49 |
void IncrementPosition(TInt& aPosition);
|
sl@0
|
50 |
TInt NumberOfEmptySlots() const;
|
sl@0
|
51 |
|
sl@0
|
52 |
private:
|
sl@0
|
53 |
TUint64 iId;
|
sl@0
|
54 |
Debug::TKernelEventAction iEventActions[Debug::EEventsLast];
|
sl@0
|
55 |
|
sl@0
|
56 |
//iEventInfo is a pointer to an object owned by the security server, so
|
sl@0
|
57 |
//no clean up needs be performed on it
|
sl@0
|
58 |
Debug::TEventInfo* iEventInfo;
|
sl@0
|
59 |
RArray<TDriverEventInfo> iEventQueue; // ring buffer.
|
sl@0
|
60 |
TClientDataRequest<Debug::TEventInfo>* iRequestGetEventStatus;
|
sl@0
|
61 |
DThread* iClientThread;
|
sl@0
|
62 |
|
sl@0
|
63 |
// Ring buffer data
|
sl@0
|
64 |
TInt iHead; // points to the next empty slot in iEventQueue (exc. when iFull == ETrue)
|
sl@0
|
65 |
TInt iTail; // points to the oldest full slot in iEventQueue (exc. when iEmpty == ETrue)
|
sl@0
|
66 |
|
sl@0
|
67 |
//if we have told the agent that we are ignoring trace events
|
sl@0
|
68 |
TBool iIgnoringTrace;
|
sl@0
|
69 |
};
|
sl@0
|
70 |
|
sl@0
|
71 |
#endif // D_DEBUG_AGENT_H
|
sl@0
|
72 |
|