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.
williamr@4
     1
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@4
     2
// All rights reserved.
williamr@4
     3
// This component and the accompanying materials are made available
williamr@4
     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
williamr@4
     5
// which accompanies this distribution, and is available
williamr@4
     6
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@4
     7
//
williamr@4
     8
// Initial Contributors:
williamr@4
     9
// Nokia Corporation - initial contribution.
williamr@4
    10
//
williamr@4
    11
// Contributors:
williamr@4
    12
//
williamr@4
    13
// Description:
williamr@4
    14
//
williamr@4
    15
williamr@4
    16
williamr@4
    17
williamr@4
    18
/**
williamr@4
    19
 @file
williamr@4
    20
 @publishedPartner 
williamr@4
    21
 @released
williamr@4
    22
*/
williamr@4
    23
williamr@4
    24
#ifndef THREADDATA_H
williamr@4
    25
#define THREADDATA_H
williamr@4
    26
williamr@4
    27
#include <streamelement.h>
williamr@4
    28
williamr@4
    29
williamr@4
    30
/**
williamr@4
    31
@publishedPartner 
williamr@4
    32
@released
williamr@4
    33
williamr@4
    34
Class that represents a thread on the target. It is based on CStreamElementBase, so
williamr@4
    35
it can be streamed between client and server.
williamr@4
    36
It is used by the Core Dump server, its clients and the plugins.
williamr@4
    37
*/
williamr@4
    38
class CThreadInfo : public CStreamElementBase
williamr@4
    39
{
williamr@4
    40
williamr@4
    41
public:
williamr@4
    42
williamr@4
    43
	IMPORT_C static CThreadInfo* NewL(  const TUint64	& aId,
williamr@4
    44
										const TDesC		& aName, 
williamr@4
    45
										const TUint64	& aProcessId,
williamr@4
    46
										const TUint		& aPriority,
williamr@4
    47
										const TLinAddr	& aSvcStackPtr,
williamr@4
    48
										const TLinAddr	& aSvcStackAddr,
williamr@4
    49
										const TUint		& aSvcStackSize,
williamr@4
    50
										const TLinAddr	& aUsrStackAddr,
williamr@4
    51
										const TUint		& aUsrStackSize );
williamr@4
    52
williamr@4
    53
	IMPORT_C static CThreadInfo* NewL( const TDesC8 & aStreamData );
williamr@4
    54
williamr@4
    55
	IMPORT_C ~CThreadInfo();
williamr@4
    56
williamr@4
    57
public:
williamr@4
    58
williamr@4
    59
	// Methods specific to CThreadInfo
williamr@4
    60
williamr@4
    61
	IMPORT_C const TUint64 & Id( ) const;
williamr@4
    62
williamr@4
    63
	IMPORT_C void NameL( const TDesC & aName );
williamr@4
    64
	IMPORT_C const TDesC & Name() const;
williamr@4
    65
	
williamr@4
    66
	IMPORT_C const TUint64 & ProcessId( ) const;
williamr@4
    67
williamr@4
    68
	IMPORT_C TUint Priority( ) const;
williamr@4
    69
	IMPORT_C TUint SvcStackPtr( ) const;
williamr@4
    70
	IMPORT_C TUint SvcStackAddr( ) const;
williamr@4
    71
	IMPORT_C TUint SvcStackSize( ) const;
williamr@4
    72
	IMPORT_C TUint UsrStackAddr( ) const;
williamr@4
    73
	IMPORT_C TUint UsrStackSize( ) const;
williamr@4
    74
williamr@4
    75
	IMPORT_C TBool Observed( ) const;
williamr@4
    76
	IMPORT_C void Observed( TBool aFlag );
williamr@4
    77
williamr@4
    78
public:
williamr@4
    79
	// Methods required by streaming interface 
williamr@4
    80
williamr@4
    81
	IMPORT_C TInt static MaxSize();
williamr@4
    82
williamr@4
    83
	IMPORT_C TInt Size() const;
williamr@4
    84
williamr@4
    85
	IMPORT_C void InternalizeL( RReadStream & aStream );
williamr@4
    86
williamr@4
    87
	IMPORT_C void ExternalizeL( RWriteStream & aStream, CBufFlat* buf );
williamr@4
    88
williamr@4
    89
williamr@4
    90
private:
williamr@4
    91
williamr@4
    92
	CThreadInfo(	const TUint64	& aId,
williamr@4
    93
					const TUint64	& aProcessId,
williamr@4
    94
					const TUint		& aPriority,
williamr@4
    95
					const TLinAddr	& aSvcStackPtr,
williamr@4
    96
					const TLinAddr	& aSvcStackAddr,
williamr@4
    97
					const TUint		& aSvcStackSize,
williamr@4
    98
					const TLinAddr	& aUsrStackAddr,
williamr@4
    99
					const TUint		& aUsrStackSize );
williamr@4
   100
williamr@4
   101
	CThreadInfo();
williamr@4
   102
williamr@4
   103
	void ConstructL( const TDesC & aName );
williamr@4
   104
williamr@4
   105
private:
williamr@4
   106
williamr@4
   107
	/** Symbian kernel thread id */
williamr@4
   108
	TUint64				iId;
williamr@4
   109
williamr@4
   110
	/** Symbian kernel thread name */
williamr@4
   111
	HBufC  *			iName;
williamr@4
   112
williamr@4
   113
	/** Symbian kernel process id of owning process */
williamr@4
   114
	TUint64				iProcessId;
williamr@4
   115
williamr@4
   116
	/** Symbian kernel thread priority TThreadPriority */
williamr@4
   117
	TUint				iPriority;
williamr@4
   118
williamr@4
   119
	/** Thread supervisor stack pointer */
williamr@4
   120
	TLinAddr			iSvcStackPtr;
williamr@4
   121
williamr@4
   122
	/** Thread supervisor mode stack base address */
williamr@4
   123
	TLinAddr			iSvcStackAddr;
williamr@4
   124
williamr@4
   125
	/** Thread supervisor mode stack size in bytes */
williamr@4
   126
	TUint				iSvcStackSize;
williamr@4
   127
williamr@4
   128
	/** Thread user mode stack base address */
williamr@4
   129
	TLinAddr			iUsrStackAddr;
williamr@4
   130
williamr@4
   131
	/** Thread user mode stack base size in bytes */
williamr@4
   132
	TUint				iUsrStackSize;
williamr@4
   133
williamr@4
   134
	/** Set to ETrue if the thread is being explicitly observed for crashes 
williamr@4
   135
	by the Core Dump Server. If only the owning process is being observed, 
williamr@4
   136
	this should be EFalse. */
williamr@4
   137
	TBool				iObserved;
williamr@4
   138
williamr@4
   139
	/** Externalized size */
williamr@4
   140
	TUint				iSize;
williamr@4
   141
williamr@4
   142
	// These are not internalised/externalised since they are spare
williamr@4
   143
	TUint32 iSpare0;
williamr@4
   144
	TUint32 iSpare1;
williamr@4
   145
	TUint32 iSpare2;
williamr@4
   146
williamr@4
   147
	};
williamr@4
   148
williamr@4
   149
williamr@4
   150
/**
williamr@4
   151
@publishedPartner 
williamr@4
   152
@released
williamr@4
   153
williamr@4
   154
List of CThreadInfo object pointers.
williamr@4
   155
@see CThreadInfo
williamr@4
   156
@see RPointerArray
williamr@4
   157
*/
williamr@4
   158
typedef RPointerArray<CThreadInfo>	RThreadPointerList;
williamr@4
   159
williamr@4
   160
williamr@4
   161
#endif // THREADDATA_H