dbgsrv/coredumpserver/interface/common/threaddata.h
changeset 0 c6b0df440bee
equal deleted inserted replaced
-1:000000000000 0:c6b0df440bee
       
     1 // Copyright (c) 2007-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 "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 //
       
    15 
       
    16 
       
    17 
       
    18 /**
       
    19  @file
       
    20  @publishedPartner 
       
    21  @released
       
    22 */
       
    23 
       
    24 #ifndef THREADDATA_H
       
    25 #define THREADDATA_H
       
    26 
       
    27 #include <streamelement.h>
       
    28 
       
    29 
       
    30 /**
       
    31 @publishedPartner 
       
    32 @released
       
    33 
       
    34 Class that represents a thread on the target. It is based on CStreamElementBase, so
       
    35 it can be streamed between client and server.
       
    36 It is used by the Core Dump server, its clients and the plugins.
       
    37 */
       
    38 class CThreadInfo : public CStreamElementBase
       
    39 {
       
    40 
       
    41 public:
       
    42 
       
    43 	IMPORT_C static CThreadInfo* NewL(  const TUint64	& aId,
       
    44 										const TDesC		& aName, 
       
    45 										const TUint64	& aProcessId,
       
    46 										const TUint		& aPriority,
       
    47 										const TLinAddr	& aSvcStackPtr,
       
    48 										const TLinAddr	& aSvcStackAddr,
       
    49 										const TUint		& aSvcStackSize,
       
    50 										const TLinAddr	& aUsrStackAddr,
       
    51 										const TUint		& aUsrStackSize);
       
    52 
       
    53 	IMPORT_C static CThreadInfo* NewL( const TDesC8 & aStreamData );
       
    54 
       
    55 	IMPORT_C ~CThreadInfo();
       
    56 
       
    57 public:
       
    58 
       
    59 	// Methods specific to CThreadInfo
       
    60 
       
    61 	IMPORT_C const TUint64 & Id( ) const;
       
    62 
       
    63 	IMPORT_C void NameL( const TDesC & aName );
       
    64 	IMPORT_C const TDesC & Name() const;
       
    65 	
       
    66 	IMPORT_C const TUint64 & ProcessId( ) const;
       
    67 
       
    68 	IMPORT_C TUint Priority( ) const;
       
    69 	IMPORT_C TUint SvcStackPtr( ) const;
       
    70 	IMPORT_C TUint SvcStackAddr( ) const;
       
    71 	IMPORT_C TUint SvcStackSize( ) const;
       
    72 	IMPORT_C TUint UsrStackAddr( ) const;
       
    73 	IMPORT_C TUint UsrStackSize( ) const;
       
    74 
       
    75 	IMPORT_C TBool Observed( ) const;
       
    76 	IMPORT_C void Observed( TBool aFlag );
       
    77 	
       
    78 	IMPORT_C void SetLastCpuId(TInt32 aLastCpu); 
       
    79 	IMPORT_C TInt32 LastCpuId() const;
       
    80 	
       
    81 	IMPORT_C void SetHeapBase(TUint32 aHeapSize); 
       
    82 	IMPORT_C TUint32 HeapBase() const;
       
    83 	
       
    84 	IMPORT_C void SetHeapSize(TUint32 lastCpu); 
       
    85 	IMPORT_C TUint32 HeapSize() const;
       
    86 	
       
    87 public:
       
    88 	// Methods required by streaming interface 
       
    89 
       
    90 	IMPORT_C TInt static MaxSize();
       
    91 
       
    92 	IMPORT_C TInt Size() const;
       
    93 
       
    94 	IMPORT_C void InternalizeL( RReadStream & aStream );
       
    95 
       
    96 	IMPORT_C void ExternalizeL( RWriteStream & aStream, CBufFlat* buf );
       
    97 	
       
    98 private:
       
    99 
       
   100 	CThreadInfo(	const TUint64	& aId,
       
   101 					const TUint64	& aProcessId,
       
   102 					const TUint		& aPriority,
       
   103 					const TLinAddr	& aSvcStackPtr,
       
   104 					const TLinAddr	& aSvcStackAddr,
       
   105 					const TUint		& aSvcStackSize,
       
   106 					const TLinAddr	& aUsrStackAddr,
       
   107 					const TUint		& aUsrStackSize);
       
   108 
       
   109 	CThreadInfo();
       
   110 
       
   111 	void ConstructL( const TDesC & aName );
       
   112 
       
   113 private:
       
   114 
       
   115 	/** Symbian kernel thread id */
       
   116 	TUint64				iId;
       
   117 
       
   118 	/** Symbian kernel thread name */
       
   119 	HBufC  *			iName;
       
   120 
       
   121 	/** Symbian kernel process id of owning process */
       
   122 	TUint64				iProcessId;
       
   123 
       
   124 	/** Symbian kernel thread priority TThreadPriority */
       
   125 	TUint				iPriority;
       
   126 
       
   127 	/** Thread supervisor stack pointer */
       
   128 	TLinAddr			iSvcStackPtr;
       
   129 
       
   130 	/** Thread supervisor mode stack base address */
       
   131 	TLinAddr			iSvcStackAddr;
       
   132 
       
   133 	/** Thread supervisor mode stack size in bytes */
       
   134 	TUint				iSvcStackSize;
       
   135 
       
   136 	/** Thread user mode stack base address */
       
   137 	TLinAddr			iUsrStackAddr;
       
   138 
       
   139 	/** Thread user mode stack base size in bytes */
       
   140 	TUint				iUsrStackSize;
       
   141 
       
   142 	/** Set to ETrue if the thread is being explicitly observed for crashes 
       
   143 	by the Core Dump Server. If only the owning process is being observed, 
       
   144 	this should be EFalse. */
       
   145 	TBool				iObserved;
       
   146 
       
   147 	/** Externalized size */
       
   148 	TUint				iSize;
       
   149 
       
   150 	/** last cpu in use when crash occurred */
       
   151 	TInt32 			iLastCpuId;  
       
   152 	
       
   153 	/** threads heap base */
       
   154 	TInt32				iHeapBase;
       
   155 	
       
   156 	/** thread heap size  */
       
   157 	TUint32				iHeapSize;
       
   158 
       
   159 	// These are not internalised/externalised since they are spare
       
   160 	TUint32 iSpare1;
       
   161 	TUint32 iSpare2;
       
   162 
       
   163 	};
       
   164 
       
   165 
       
   166 /**
       
   167 @publishedPartner 
       
   168 @released
       
   169 
       
   170 List of CThreadInfo object pointers.
       
   171 @see CThreadInfo
       
   172 @see RPointerArray
       
   173 */
       
   174 typedef RPointerArray<CThreadInfo>	RThreadPointerList;
       
   175 
       
   176 
       
   177 #endif // THREADDATA_H