epoc32/include/tools/coredump/threaddata.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.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 public:
    79 	// Methods required by streaming interface 
    80 
    81 	IMPORT_C TInt static MaxSize();
    82 
    83 	IMPORT_C TInt Size() const;
    84 
    85 	IMPORT_C void InternalizeL( RReadStream & aStream );
    86 
    87 	IMPORT_C void ExternalizeL( RWriteStream & aStream, CBufFlat* buf );
    88 
    89 
    90 private:
    91 
    92 	CThreadInfo(	const TUint64	& aId,
    93 					const TUint64	& aProcessId,
    94 					const TUint		& aPriority,
    95 					const TLinAddr	& aSvcStackPtr,
    96 					const TLinAddr	& aSvcStackAddr,
    97 					const TUint		& aSvcStackSize,
    98 					const TLinAddr	& aUsrStackAddr,
    99 					const TUint		& aUsrStackSize );
   100 
   101 	CThreadInfo();
   102 
   103 	void ConstructL( const TDesC & aName );
   104 
   105 private:
   106 
   107 	/** Symbian kernel thread id */
   108 	TUint64				iId;
   109 
   110 	/** Symbian kernel thread name */
   111 	HBufC  *			iName;
   112 
   113 	/** Symbian kernel process id of owning process */
   114 	TUint64				iProcessId;
   115 
   116 	/** Symbian kernel thread priority TThreadPriority */
   117 	TUint				iPriority;
   118 
   119 	/** Thread supervisor stack pointer */
   120 	TLinAddr			iSvcStackPtr;
   121 
   122 	/** Thread supervisor mode stack base address */
   123 	TLinAddr			iSvcStackAddr;
   124 
   125 	/** Thread supervisor mode stack size in bytes */
   126 	TUint				iSvcStackSize;
   127 
   128 	/** Thread user mode stack base address */
   129 	TLinAddr			iUsrStackAddr;
   130 
   131 	/** Thread user mode stack base size in bytes */
   132 	TUint				iUsrStackSize;
   133 
   134 	/** Set to ETrue if the thread is being explicitly observed for crashes 
   135 	by the Core Dump Server. If only the owning process is being observed, 
   136 	this should be EFalse. */
   137 	TBool				iObserved;
   138 
   139 	/** Externalized size */
   140 	TUint				iSize;
   141 
   142 	// These are not internalised/externalised since they are spare
   143 	TUint32 iSpare0;
   144 	TUint32 iSpare1;
   145 	TUint32 iSpare2;
   146 
   147 	};
   148 
   149 
   150 /**
   151 @publishedPartner 
   152 @released
   153 
   154 List of CThreadInfo object pointers.
   155 @see CThreadInfo
   156 @see RPointerArray
   157 */
   158 typedef RPointerArray<CThreadInfo>	RThreadPointerList;
   159 
   160 
   161 #endif // THREADDATA_H