epoc32/include/tools/coredump/crashdatasource.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) 2006-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 // Definition of Data Source API that supplies crash information. 
    15 //
    16 
    17 
    18 
    19 /**
    20  @file
    21  @publishedPartner 
    22  @released
    23 */
    24 
    25 
    26 #ifndef CRASH_DATA_SOURCE_H
    27 #define CRASH_DATA_SOURCE_H
    28 
    29 #include <e32std.h>
    30 #include <e32base.h>
    31 
    32 #include <crashdata.h>
    33 #include <processdata.h>
    34 #include <executabledata.h>
    35 #include <threaddata.h>
    36 
    37 
    38 /**
    39 Definition of the Data Source API. This API is used by formatters to obtain crash data from 
    40 the Core Dump Server. The Core Dump Server derives and implements this API.
    41 */
    42 class CCrashDataSource : public CBase
    43 {
    44 protected:
    45 
    46 	/** Standard second-phase constructor. */
    47 	virtual void ConstructL() = 0;
    48 	
    49 public:
    50 	
    51 	/** 
    52 	This call returns information on all available registers. It does not
    53 	return the register contents. This is used to establish which registers 
    54 	a caller could ask for, in particular for Co Processor registers. 
    55 	The callee (not the caller) allocates aRegisterList. 
    56 	This method is used by a formatter to establish which registers it can ask for, 
    57 	and thus need only be called once per session. 
    58 
    59     @param aRegisterList Returned register list with available registers.
    60 
    61     @see TRegisterData.
    62 	@see RRegisterList.
    63 	*/
    64 	virtual void GetRegisterListL( RRegisterList  &	aRegisterList ) = 0;
    65 
    66 	/** 
    67 	Ask the Core Dump server for some register data. The caller allocates
    68 	the array and fills in the details of the registers for which it would like 
    69 	the contents.
    70 	@param aThreadId Thread to read registers from.
    71 	@param aRegisterList Returned register list with current values.
    72 
    73     @see TRegisterData.
    74 	@see GetRegisterListL().
    75 	@see RRegisterList.
    76 	*/
    77 	virtual void ReadRegistersL( const TUint64 aThreadId, RRegisterList &aRegisterList ) = 0;
    78 
    79 	/**
    80  	Read data from target relative to a particular thread. 
    81 	The caller assumes ownership of the resulting data descriptor.
    82  	
    83  	@param aThreadId Memory read is relative to this thread parameter
    84 	@param aAddress Virtual address to read from
    85     @param aLength Number of bytes to read
    86 	@param aData Descriptor for read data
    87 	*/
    88 	virtual void ReadMemoryL(
    89                    const TUint64    aThreadId,
    90                    const TUint32    aAddress,
    91                    const TUint32    aLength,
    92                    TDes8          & aData ) = 0;
    93 
    94 
    95 	/**
    96  	Read the current process list.
    97 	The caller assumes ownership of resulting data.
    98 	@param aData Array of currently running processes . 
    99 	
   100 	@see RProcessPointerList.
   101 	@see CProcessInfo.
   102 	*/
   103 	virtual void GetProcessListL( RProcessPointerList & aData )
   104 		{
   105 		TUint totalProcessListDescSize;
   106 		GetProcessListL( aData, totalProcessListDescSize );
   107 		};
   108 
   109 	/**
   110  	Read the current process list.
   111 	The caller assumes ownership of the resulting data.
   112 	This call is only useful if the total descriptor size required for 
   113 	transferring across the client-server boundary must be known.
   114 	
   115  	@param aData	Array of currently running processes. 
   116 	@param aTotalProcessListDescSize Total descriptor size required 
   117 	to transfer the list across the client-server interface.
   118 
   119     @see RProcessPointerList.
   120 	@see CProcessInfo.
   121 	*/
   122 	virtual void GetProcessListL( RProcessPointerList & aData, 
   123 						         TUint & aTotalProcessListDescSize ) = 0;
   124 
   125 
   126 	/**
   127  	Read the current executable list. The caller assumes ownership of the resulting data.
   128 	@param aData Array of current executables. 
   129 
   130 	@see RExecutablePointerList.
   131 	@see CExecutableInfo
   132 	*/
   133 	virtual void GetExecutableListL( RExecutablePointerList & aData )
   134 		{
   135 		TUint totalExecutableListDescSize;
   136 		GetExecutableListL( aData, totalExecutableListDescSize );
   137 		};
   138 
   139 
   140 	/**
   141  	Read the current executable list.
   142 	The caller assumes ownership of the resulting data.
   143 	This call is only useful if the total descriptor size required for 
   144 	transferring across the client-server boundary must be known.
   145 	
   146  	@param aData	Array of current executables. 
   147 	@param aTotalExecutableListDescSize	Total descriptor size required 
   148 	to transfer the list across the client-server interface.
   149 
   150 	@see RExecutablePointerList.
   151 	@see CExecutableInfo
   152 	*/
   153 	virtual void GetExecutableListL( RExecutablePointerList & aData, 
   154 						         TUint & aTotalExecutableListDescSize ) = 0;
   155 
   156 
   157  	/** 
   158 	Read the current thread list.
   159 	This call is only useful if the total descriptor size required for 
   160 	transferring across the client-server boundary must be known.
   161 
   162 	@param aProcessId If this argument is -1, all the threads in the 
   163 	system are returned. Otherwise the threads under the process with the id
   164 	aProcessId are returned.
   165  	@param aThreadList Array of currently running threads. 
   166 	@param aTotalThreadListDescSize Size in bytes of the descriptor 
   167 	required to transfer the data over the client server interface.
   168 
   169   	@see CThreadInfo
   170     @see RThreadPointerList.
   171 	@see GetThreadListL
   172 	*/
   173 	virtual void GetThreadListL( const TUint64 aProcessId, 
   174 						RThreadPointerList & aThreadList,
   175 						TUint & aTotalThreadListDescSize ) = 0;
   176 
   177 	/**
   178  	Read the current thread list.
   179 	The caller assumes ownership of the resulting data.
   180 	
   181 	@param aProcessId If this argument is -1, all the threads in the 
   182 	system are returned. Otherwise the threads under the process with the id
   183 	aProcessId are returned.
   184  	@param aThreadList	Array of currently running threads.
   185 	
   186 	@see CThreadInfo
   187 	@see RThreadPointerList
   188 	*/
   189   	virtual void GetThreadListL( const TUint64 aProcessId, 
   190 								 RThreadPointerList & aThreadList )
   191 		{
   192 		TUint totalThreadListDescSize;
   193 		GetThreadListL(	aProcessId, aThreadList, totalThreadListDescSize );
   194 		};
   195 
   196     /**
   197 	Obtain a list of the code segments for a process. 
   198 	
   199 	@param aTid Thread identifier to obtain code segments for.
   200 	@param aCodeSegs Array of code segments. 
   201 	@param aTotalCodeSegListDescSize Size in bytes of the descriptor 
   202 	required to transfer the data over the client server interface.
   203 
   204 	@see RCodeSegPointerList
   205 	@see TSegmentInfo
   206 	*/
   207     virtual void GetCodeSegmentsL(const TUint64 aTid, 
   208 									RCodeSegPointerList &aCodeSegs, 
   209 									TUint &aTotalCodeSegListDescSize ) = 0;
   210 
   211     /**
   212 	Obtain a list of the code segments for a process. 
   213 
   214 	@param aTid Thread identifier to obtain code segments for.
   215 	@param aCodeSegs Array of code segments. 
   216 
   217 	@see RCodeSegPointerList
   218 	@see TSegmentInfo
   219 	*/
   220     virtual void GetCodeSegmentsL(const TUint64 aTid, RCodeSegPointerList &aCodeSegs)
   221         {
   222         TUint totalThreadListDescSize;
   223         GetCodeSegmentsL(aTid, aCodeSegs, totalThreadListDescSize);
   224         };
   225 
   226 	/** For future expansion
   227 	@internalTechnology */
   228 	TUint32 iSpare1;
   229 
   230 	/** @internalTechnology */
   231 	TUint32 iSpare2;
   232 };
   233 
   234 #endif // CRASH_DATA_SOURCE_H
   235 
   236