williamr@4: // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@4: // All rights reserved.
williamr@4: // This component and the accompanying materials are made available
williamr@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: // which accompanies this distribution, and is available
williamr@4: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@4: //
williamr@4: // Initial Contributors:
williamr@4: // Nokia Corporation - initial contribution.
williamr@4: //
williamr@4: // Contributors:
williamr@4: //
williamr@4: // Description:
williamr@4: // Definition of Data Source API that supplies crash information. 
williamr@4: //
williamr@4: 
williamr@4: 
williamr@4: 
williamr@4: /**
williamr@4:  @file
williamr@4:  @publishedPartner 
williamr@4:  @released
williamr@4: */
williamr@4: 
williamr@4: 
williamr@4: #ifndef CRASH_DATA_SOURCE_H
williamr@4: #define CRASH_DATA_SOURCE_H
williamr@4: 
williamr@4: #include <e32std.h>
williamr@4: #include <e32base.h>
williamr@4: 
williamr@4: #include <crashdata.h>
williamr@4: #include <processdata.h>
williamr@4: #include <executabledata.h>
williamr@4: #include <threaddata.h>
williamr@4: 
williamr@4: 
williamr@4: /**
williamr@4: Definition of the Data Source API. This API is used by formatters to obtain crash data from 
williamr@4: the Core Dump Server. The Core Dump Server derives and implements this API.
williamr@4: */
williamr@4: class CCrashDataSource : public CBase
williamr@4: {
williamr@4: protected:
williamr@4: 
williamr@4: 	/** Standard second-phase constructor. */
williamr@4: 	virtual void ConstructL() = 0;
williamr@4: 	
williamr@4: public:
williamr@4: 	
williamr@4: 	/** 
williamr@4: 	This call returns information on all available registers. It does not
williamr@4: 	return the register contents. This is used to establish which registers 
williamr@4: 	a caller could ask for, in particular for Co Processor registers. 
williamr@4: 	The callee (not the caller) allocates aRegisterList. 
williamr@4: 	This method is used by a formatter to establish which registers it can ask for, 
williamr@4: 	and thus need only be called once per session. 
williamr@4: 
williamr@4:     @param aRegisterList Returned register list with available registers.
williamr@4: 
williamr@4:     @see TRegisterData.
williamr@4: 	@see RRegisterList.
williamr@4: 	*/
williamr@4: 	virtual void GetRegisterListL( RRegisterList  &	aRegisterList ) = 0;
williamr@4: 
williamr@4: 	/** 
williamr@4: 	Ask the Core Dump server for some register data. The caller allocates
williamr@4: 	the array and fills in the details of the registers for which it would like 
williamr@4: 	the contents.
williamr@4: 	@param aThreadId Thread to read registers from.
williamr@4: 	@param aRegisterList Returned register list with current values.
williamr@4: 
williamr@4:     @see TRegisterData.
williamr@4: 	@see GetRegisterListL().
williamr@4: 	@see RRegisterList.
williamr@4: 	*/
williamr@4: 	virtual void ReadRegistersL( const TUint64 aThreadId, RRegisterList &aRegisterList ) = 0;
williamr@4: 
williamr@4: 	/**
williamr@4:  	Read data from target relative to a particular thread. 
williamr@4: 	The caller assumes ownership of the resulting data descriptor.
williamr@4:  	
williamr@4:  	@param aThreadId Memory read is relative to this thread parameter
williamr@4: 	@param aAddress Virtual address to read from
williamr@4:     @param aLength Number of bytes to read
williamr@4: 	@param aData Descriptor for read data
williamr@4: 	*/
williamr@4: 	virtual void ReadMemoryL(
williamr@4:                    const TUint64    aThreadId,
williamr@4:                    const TUint32    aAddress,
williamr@4:                    const TUint32    aLength,
williamr@4:                    TDes8          & aData ) = 0;
williamr@4: 
williamr@4: 
williamr@4: 	/**
williamr@4:  	Read the current process list.
williamr@4: 	The caller assumes ownership of resulting data.
williamr@4: 	@param aData Array of currently running processes . 
williamr@4: 	
williamr@4: 	@see RProcessPointerList.
williamr@4: 	@see CProcessInfo.
williamr@4: 	*/
williamr@4: 	virtual void GetProcessListL( RProcessPointerList & aData )
williamr@4: 		{
williamr@4: 		TUint totalProcessListDescSize;
williamr@4: 		GetProcessListL( aData, totalProcessListDescSize );
williamr@4: 		};
williamr@4: 
williamr@4: 	/**
williamr@4:  	Read the current process list.
williamr@4: 	The caller assumes ownership of the resulting data.
williamr@4: 	This call is only useful if the total descriptor size required for 
williamr@4: 	transferring across the client-server boundary must be known.
williamr@4: 	
williamr@4:  	@param aData	Array of currently running processes. 
williamr@4: 	@param aTotalProcessListDescSize Total descriptor size required 
williamr@4: 	to transfer the list across the client-server interface.
williamr@4: 
williamr@4:     @see RProcessPointerList.
williamr@4: 	@see CProcessInfo.
williamr@4: 	*/
williamr@4: 	virtual void GetProcessListL( RProcessPointerList & aData, 
williamr@4: 						         TUint & aTotalProcessListDescSize ) = 0;
williamr@4: 
williamr@4: 
williamr@4: 	/**
williamr@4:  	Read the current executable list. The caller assumes ownership of the resulting data.
williamr@4: 	@param aData Array of current executables. 
williamr@4: 
williamr@4: 	@see RExecutablePointerList.
williamr@4: 	@see CExecutableInfo
williamr@4: 	*/
williamr@4: 	virtual void GetExecutableListL( RExecutablePointerList & aData )
williamr@4: 		{
williamr@4: 		TUint totalExecutableListDescSize;
williamr@4: 		GetExecutableListL( aData, totalExecutableListDescSize );
williamr@4: 		};
williamr@4: 
williamr@4: 
williamr@4: 	/**
williamr@4:  	Read the current executable list.
williamr@4: 	The caller assumes ownership of the resulting data.
williamr@4: 	This call is only useful if the total descriptor size required for 
williamr@4: 	transferring across the client-server boundary must be known.
williamr@4: 	
williamr@4:  	@param aData	Array of current executables. 
williamr@4: 	@param aTotalExecutableListDescSize	Total descriptor size required 
williamr@4: 	to transfer the list across the client-server interface.
williamr@4: 
williamr@4: 	@see RExecutablePointerList.
williamr@4: 	@see CExecutableInfo
williamr@4: 	*/
williamr@4: 	virtual void GetExecutableListL( RExecutablePointerList & aData, 
williamr@4: 						         TUint & aTotalExecutableListDescSize ) = 0;
williamr@4: 
williamr@4: 
williamr@4:  	/** 
williamr@4: 	Read the current thread list.
williamr@4: 	This call is only useful if the total descriptor size required for 
williamr@4: 	transferring across the client-server boundary must be known.
williamr@4: 
williamr@4: 	@param aProcessId If this argument is -1, all the threads in the 
williamr@4: 	system are returned. Otherwise the threads under the process with the id
williamr@4: 	aProcessId are returned.
williamr@4:  	@param aThreadList Array of currently running threads. 
williamr@4: 	@param aTotalThreadListDescSize Size in bytes of the descriptor 
williamr@4: 	required to transfer the data over the client server interface.
williamr@4: 
williamr@4:   	@see CThreadInfo
williamr@4:     @see RThreadPointerList.
williamr@4: 	@see GetThreadListL
williamr@4: 	*/
williamr@4: 	virtual void GetThreadListL( const TUint64 aProcessId, 
williamr@4: 						RThreadPointerList & aThreadList,
williamr@4: 						TUint & aTotalThreadListDescSize ) = 0;
williamr@4: 
williamr@4: 	/**
williamr@4:  	Read the current thread list.
williamr@4: 	The caller assumes ownership of the resulting data.
williamr@4: 	
williamr@4: 	@param aProcessId If this argument is -1, all the threads in the 
williamr@4: 	system are returned. Otherwise the threads under the process with the id
williamr@4: 	aProcessId are returned.
williamr@4:  	@param aThreadList	Array of currently running threads.
williamr@4: 	
williamr@4: 	@see CThreadInfo
williamr@4: 	@see RThreadPointerList
williamr@4: 	*/
williamr@4:   	virtual void GetThreadListL( const TUint64 aProcessId, 
williamr@4: 								 RThreadPointerList & aThreadList )
williamr@4: 		{
williamr@4: 		TUint totalThreadListDescSize;
williamr@4: 		GetThreadListL(	aProcessId, aThreadList, totalThreadListDescSize );
williamr@4: 		};
williamr@4: 
williamr@4:     /**
williamr@4: 	Obtain a list of the code segments for a process. 
williamr@4: 	
williamr@4: 	@param aTid Thread identifier to obtain code segments for.
williamr@4: 	@param aCodeSegs Array of code segments. 
williamr@4: 	@param aTotalCodeSegListDescSize Size in bytes of the descriptor 
williamr@4: 	required to transfer the data over the client server interface.
williamr@4: 
williamr@4: 	@see RCodeSegPointerList
williamr@4: 	@see TSegmentInfo
williamr@4: 	*/
williamr@4:     virtual void GetCodeSegmentsL(const TUint64 aTid, 
williamr@4: 									RCodeSegPointerList &aCodeSegs, 
williamr@4: 									TUint &aTotalCodeSegListDescSize ) = 0;
williamr@4: 
williamr@4:     /**
williamr@4: 	Obtain a list of the code segments for a process. 
williamr@4: 
williamr@4: 	@param aTid Thread identifier to obtain code segments for.
williamr@4: 	@param aCodeSegs Array of code segments. 
williamr@4: 
williamr@4: 	@see RCodeSegPointerList
williamr@4: 	@see TSegmentInfo
williamr@4: 	*/
williamr@4:     virtual void GetCodeSegmentsL(const TUint64 aTid, RCodeSegPointerList &aCodeSegs)
williamr@4:         {
williamr@4:         TUint totalThreadListDescSize;
williamr@4:         GetCodeSegmentsL(aTid, aCodeSegs, totalThreadListDescSize);
williamr@4:         };
williamr@4: 
williamr@4: 	/** For future expansion
williamr@4: 	@internalTechnology */
williamr@4: 	TUint32 iSpare1;
williamr@4: 
williamr@4: 	/** @internalTechnology */
williamr@4: 	TUint32 iSpare2;
williamr@4: };
williamr@4: 
williamr@4: #endif // CRASH_DATA_SOURCE_H
williamr@4: 
williamr@4: