epoc32/include/tools/coredump/crashdatasource.h
branchSymbian3
changeset 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/tools/coredump/crashdatasource.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -0,0 +1,236 @@
     1.4 +// Copyright (c) 2006-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 +// Definition of Data Source API that supplies crash information. 
    1.18 +//
    1.19 +
    1.20 +
    1.21 +
    1.22 +/**
    1.23 + @file
    1.24 + @publishedPartner 
    1.25 + @released
    1.26 +*/
    1.27 +
    1.28 +
    1.29 +#ifndef CRASH_DATA_SOURCE_H
    1.30 +#define CRASH_DATA_SOURCE_H
    1.31 +
    1.32 +#include <e32std.h>
    1.33 +#include <e32base.h>
    1.34 +
    1.35 +#include <crashdata.h>
    1.36 +#include <processdata.h>
    1.37 +#include <executabledata.h>
    1.38 +#include <threaddata.h>
    1.39 +
    1.40 +
    1.41 +/**
    1.42 +Definition of the Data Source API. This API is used by formatters to obtain crash data from 
    1.43 +the Core Dump Server. The Core Dump Server derives and implements this API.
    1.44 +*/
    1.45 +class CCrashDataSource : public CBase
    1.46 +{
    1.47 +protected:
    1.48 +
    1.49 +	/** Standard second-phase constructor. */
    1.50 +	virtual void ConstructL() = 0;
    1.51 +	
    1.52 +public:
    1.53 +	
    1.54 +	/** 
    1.55 +	This call returns information on all available registers. It does not
    1.56 +	return the register contents. This is used to establish which registers 
    1.57 +	a caller could ask for, in particular for Co Processor registers. 
    1.58 +	The callee (not the caller) allocates aRegisterList. 
    1.59 +	This method is used by a formatter to establish which registers it can ask for, 
    1.60 +	and thus need only be called once per session. 
    1.61 +
    1.62 +    @param aRegisterList Returned register list with available registers.
    1.63 +
    1.64 +    @see TRegisterData.
    1.65 +	@see RRegisterList.
    1.66 +	*/
    1.67 +	virtual void GetRegisterListL( RRegisterList  &	aRegisterList ) = 0;
    1.68 +
    1.69 +	/** 
    1.70 +	Ask the Core Dump server for some register data. The caller allocates
    1.71 +	the array and fills in the details of the registers for which it would like 
    1.72 +	the contents.
    1.73 +	@param aThreadId Thread to read registers from.
    1.74 +	@param aRegisterList Returned register list with current values.
    1.75 +
    1.76 +    @see TRegisterData.
    1.77 +	@see GetRegisterListL().
    1.78 +	@see RRegisterList.
    1.79 +	*/
    1.80 +	virtual void ReadRegistersL( const TUint64 aThreadId, RRegisterList &aRegisterList ) = 0;
    1.81 +
    1.82 +	/**
    1.83 + 	Read data from target relative to a particular thread. 
    1.84 +	The caller assumes ownership of the resulting data descriptor.
    1.85 + 	
    1.86 + 	@param aThreadId Memory read is relative to this thread parameter
    1.87 +	@param aAddress Virtual address to read from
    1.88 +    @param aLength Number of bytes to read
    1.89 +	@param aData Descriptor for read data
    1.90 +	*/
    1.91 +	virtual void ReadMemoryL(
    1.92 +                   const TUint64    aThreadId,
    1.93 +                   const TUint32    aAddress,
    1.94 +                   const TUint32    aLength,
    1.95 +                   TDes8          & aData ) = 0;
    1.96 +
    1.97 +
    1.98 +	/**
    1.99 + 	Read the current process list.
   1.100 +	The caller assumes ownership of resulting data.
   1.101 +	@param aData Array of currently running processes . 
   1.102 +	
   1.103 +	@see RProcessPointerList.
   1.104 +	@see CProcessInfo.
   1.105 +	*/
   1.106 +	virtual void GetProcessListL( RProcessPointerList & aData )
   1.107 +		{
   1.108 +		TUint totalProcessListDescSize;
   1.109 +		GetProcessListL( aData, totalProcessListDescSize );
   1.110 +		};
   1.111 +
   1.112 +	/**
   1.113 + 	Read the current process list.
   1.114 +	The caller assumes ownership of the resulting data.
   1.115 +	This call is only useful if the total descriptor size required for 
   1.116 +	transferring across the client-server boundary must be known.
   1.117 +	
   1.118 + 	@param aData	Array of currently running processes. 
   1.119 +	@param aTotalProcessListDescSize Total descriptor size required 
   1.120 +	to transfer the list across the client-server interface.
   1.121 +
   1.122 +    @see RProcessPointerList.
   1.123 +	@see CProcessInfo.
   1.124 +	*/
   1.125 +	virtual void GetProcessListL( RProcessPointerList & aData, 
   1.126 +						         TUint & aTotalProcessListDescSize ) = 0;
   1.127 +
   1.128 +
   1.129 +	/**
   1.130 + 	Read the current executable list. The caller assumes ownership of the resulting data.
   1.131 +	@param aData Array of current executables. 
   1.132 +
   1.133 +	@see RExecutablePointerList.
   1.134 +	@see CExecutableInfo
   1.135 +	*/
   1.136 +	virtual void GetExecutableListL( RExecutablePointerList & aData )
   1.137 +		{
   1.138 +		TUint totalExecutableListDescSize;
   1.139 +		GetExecutableListL( aData, totalExecutableListDescSize );
   1.140 +		};
   1.141 +
   1.142 +
   1.143 +	/**
   1.144 + 	Read the current executable list.
   1.145 +	The caller assumes ownership of the resulting data.
   1.146 +	This call is only useful if the total descriptor size required for 
   1.147 +	transferring across the client-server boundary must be known.
   1.148 +	
   1.149 + 	@param aData	Array of current executables. 
   1.150 +	@param aTotalExecutableListDescSize	Total descriptor size required 
   1.151 +	to transfer the list across the client-server interface.
   1.152 +
   1.153 +	@see RExecutablePointerList.
   1.154 +	@see CExecutableInfo
   1.155 +	*/
   1.156 +	virtual void GetExecutableListL( RExecutablePointerList & aData, 
   1.157 +						         TUint & aTotalExecutableListDescSize ) = 0;
   1.158 +
   1.159 +
   1.160 + 	/** 
   1.161 +	Read the current thread list.
   1.162 +	This call is only useful if the total descriptor size required for 
   1.163 +	transferring across the client-server boundary must be known.
   1.164 +
   1.165 +	@param aProcessId If this argument is -1, all the threads in the 
   1.166 +	system are returned. Otherwise the threads under the process with the id
   1.167 +	aProcessId are returned.
   1.168 + 	@param aThreadList Array of currently running threads. 
   1.169 +	@param aTotalThreadListDescSize Size in bytes of the descriptor 
   1.170 +	required to transfer the data over the client server interface.
   1.171 +
   1.172 +  	@see CThreadInfo
   1.173 +    @see RThreadPointerList.
   1.174 +	@see GetThreadListL
   1.175 +	*/
   1.176 +	virtual void GetThreadListL( const TUint64 aProcessId, 
   1.177 +						RThreadPointerList & aThreadList,
   1.178 +						TUint & aTotalThreadListDescSize ) = 0;
   1.179 +
   1.180 +	/**
   1.181 + 	Read the current thread list.
   1.182 +	The caller assumes ownership of the resulting data.
   1.183 +	
   1.184 +	@param aProcessId If this argument is -1, all the threads in the 
   1.185 +	system are returned. Otherwise the threads under the process with the id
   1.186 +	aProcessId are returned.
   1.187 + 	@param aThreadList	Array of currently running threads.
   1.188 +	
   1.189 +	@see CThreadInfo
   1.190 +	@see RThreadPointerList
   1.191 +	*/
   1.192 +  	virtual void GetThreadListL( const TUint64 aProcessId, 
   1.193 +								 RThreadPointerList & aThreadList )
   1.194 +		{
   1.195 +		TUint totalThreadListDescSize;
   1.196 +		GetThreadListL(	aProcessId, aThreadList, totalThreadListDescSize );
   1.197 +		};
   1.198 +
   1.199 +    /**
   1.200 +	Obtain a list of the code segments for a process. 
   1.201 +	
   1.202 +	@param aTid Thread identifier to obtain code segments for.
   1.203 +	@param aCodeSegs Array of code segments. 
   1.204 +	@param aTotalCodeSegListDescSize Size in bytes of the descriptor 
   1.205 +	required to transfer the data over the client server interface.
   1.206 +
   1.207 +	@see RCodeSegPointerList
   1.208 +	@see TSegmentInfo
   1.209 +	*/
   1.210 +    virtual void GetCodeSegmentsL(const TUint64 aTid, 
   1.211 +									RCodeSegPointerList &aCodeSegs, 
   1.212 +									TUint &aTotalCodeSegListDescSize ) = 0;
   1.213 +
   1.214 +    /**
   1.215 +	Obtain a list of the code segments for a process. 
   1.216 +
   1.217 +	@param aTid Thread identifier to obtain code segments for.
   1.218 +	@param aCodeSegs Array of code segments. 
   1.219 +
   1.220 +	@see RCodeSegPointerList
   1.221 +	@see TSegmentInfo
   1.222 +	*/
   1.223 +    virtual void GetCodeSegmentsL(const TUint64 aTid, RCodeSegPointerList &aCodeSegs)
   1.224 +        {
   1.225 +        TUint totalThreadListDescSize;
   1.226 +        GetCodeSegmentsL(aTid, aCodeSegs, totalThreadListDescSize);
   1.227 +        };
   1.228 +
   1.229 +	/** For future expansion
   1.230 +	@internalTechnology */
   1.231 +	TUint32 iSpare1;
   1.232 +
   1.233 +	/** @internalTechnology */
   1.234 +	TUint32 iSpare2;
   1.235 +};
   1.236 +
   1.237 +#endif // CRASH_DATA_SOURCE_H
   1.238 +
   1.239 +