1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/tools/coredump/threaddata.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -0,0 +1,161 @@
1.4 +// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// 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
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +
1.20 +
1.21 +/**
1.22 + @file
1.23 + @publishedPartner
1.24 + @released
1.25 +*/
1.26 +
1.27 +#ifndef THREADDATA_H
1.28 +#define THREADDATA_H
1.29 +
1.30 +#include <streamelement.h>
1.31 +
1.32 +
1.33 +/**
1.34 +@publishedPartner
1.35 +@released
1.36 +
1.37 +Class that represents a thread on the target. It is based on CStreamElementBase, so
1.38 +it can be streamed between client and server.
1.39 +It is used by the Core Dump server, its clients and the plugins.
1.40 +*/
1.41 +class CThreadInfo : public CStreamElementBase
1.42 +{
1.43 +
1.44 +public:
1.45 +
1.46 + IMPORT_C static CThreadInfo* NewL( const TUint64 & aId,
1.47 + const TDesC & aName,
1.48 + const TUint64 & aProcessId,
1.49 + const TUint & aPriority,
1.50 + const TLinAddr & aSvcStackPtr,
1.51 + const TLinAddr & aSvcStackAddr,
1.52 + const TUint & aSvcStackSize,
1.53 + const TLinAddr & aUsrStackAddr,
1.54 + const TUint & aUsrStackSize );
1.55 +
1.56 + IMPORT_C static CThreadInfo* NewL( const TDesC8 & aStreamData );
1.57 +
1.58 + IMPORT_C ~CThreadInfo();
1.59 +
1.60 +public:
1.61 +
1.62 + // Methods specific to CThreadInfo
1.63 +
1.64 + IMPORT_C const TUint64 & Id( ) const;
1.65 +
1.66 + IMPORT_C void NameL( const TDesC & aName );
1.67 + IMPORT_C const TDesC & Name() const;
1.68 +
1.69 + IMPORT_C const TUint64 & ProcessId( ) const;
1.70 +
1.71 + IMPORT_C TUint Priority( ) const;
1.72 + IMPORT_C TUint SvcStackPtr( ) const;
1.73 + IMPORT_C TUint SvcStackAddr( ) const;
1.74 + IMPORT_C TUint SvcStackSize( ) const;
1.75 + IMPORT_C TUint UsrStackAddr( ) const;
1.76 + IMPORT_C TUint UsrStackSize( ) const;
1.77 +
1.78 + IMPORT_C TBool Observed( ) const;
1.79 + IMPORT_C void Observed( TBool aFlag );
1.80 +
1.81 +public:
1.82 + // Methods required by streaming interface
1.83 +
1.84 + IMPORT_C TInt static MaxSize();
1.85 +
1.86 + IMPORT_C TInt Size() const;
1.87 +
1.88 + IMPORT_C void InternalizeL( RReadStream & aStream );
1.89 +
1.90 + IMPORT_C void ExternalizeL( RWriteStream & aStream, CBufFlat* buf );
1.91 +
1.92 +
1.93 +private:
1.94 +
1.95 + CThreadInfo( const TUint64 & aId,
1.96 + const TUint64 & aProcessId,
1.97 + const TUint & aPriority,
1.98 + const TLinAddr & aSvcStackPtr,
1.99 + const TLinAddr & aSvcStackAddr,
1.100 + const TUint & aSvcStackSize,
1.101 + const TLinAddr & aUsrStackAddr,
1.102 + const TUint & aUsrStackSize );
1.103 +
1.104 + CThreadInfo();
1.105 +
1.106 + void ConstructL( const TDesC & aName );
1.107 +
1.108 +private:
1.109 +
1.110 + /** Symbian kernel thread id */
1.111 + TUint64 iId;
1.112 +
1.113 + /** Symbian kernel thread name */
1.114 + HBufC * iName;
1.115 +
1.116 + /** Symbian kernel process id of owning process */
1.117 + TUint64 iProcessId;
1.118 +
1.119 + /** Symbian kernel thread priority TThreadPriority */
1.120 + TUint iPriority;
1.121 +
1.122 + /** Thread supervisor stack pointer */
1.123 + TLinAddr iSvcStackPtr;
1.124 +
1.125 + /** Thread supervisor mode stack base address */
1.126 + TLinAddr iSvcStackAddr;
1.127 +
1.128 + /** Thread supervisor mode stack size in bytes */
1.129 + TUint iSvcStackSize;
1.130 +
1.131 + /** Thread user mode stack base address */
1.132 + TLinAddr iUsrStackAddr;
1.133 +
1.134 + /** Thread user mode stack base size in bytes */
1.135 + TUint iUsrStackSize;
1.136 +
1.137 + /** Set to ETrue if the thread is being explicitly observed for crashes
1.138 + by the Core Dump Server. If only the owning process is being observed,
1.139 + this should be EFalse. */
1.140 + TBool iObserved;
1.141 +
1.142 + /** Externalized size */
1.143 + TUint iSize;
1.144 +
1.145 + // These are not internalised/externalised since they are spare
1.146 + TUint32 iSpare0;
1.147 + TUint32 iSpare1;
1.148 + TUint32 iSpare2;
1.149 +
1.150 + };
1.151 +
1.152 +
1.153 +/**
1.154 +@publishedPartner
1.155 +@released
1.156 +
1.157 +List of CThreadInfo object pointers.
1.158 +@see CThreadInfo
1.159 +@see RPointerArray
1.160 +*/
1.161 +typedef RPointerArray<CThreadInfo> RThreadPointerList;
1.162 +
1.163 +
1.164 +#endif // THREADDATA_H