# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1273847103 -10800 # Node ID 67c6ff54ec25c716128fadf6049927206f226f59 # Parent ccab7f1f8266bfe2b810d758bbd7bcb2775a7802 Revision: 201019 Kit: 201019 diff -r ccab7f1f8266 -r 67c6ff54ec25 hti/HtiCommPlugins/HtiBtCommPlugin/group/HtiBtSerialComHelper.mmp --- a/hti/HtiCommPlugins/HtiBtCommPlugin/group/HtiBtSerialComHelper.mmp Mon May 03 13:58:41 2010 +0300 +++ b/hti/HtiCommPlugins/HtiBtCommPlugin/group/HtiBtSerialComHelper.mmp Fri May 14 17:25:03 2010 +0300 @@ -39,7 +39,6 @@ USERINCLUDE ../BtEngine/inc OS_LAYER_SYSTEMINCLUDE -LIBRARY apparc.lib LIBRARY bafl.lib LIBRARY bluetooth.lib LIBRARY btdevice.lib @@ -47,7 +46,6 @@ LIBRARY btmanclient.lib LIBRARY btpowercontrol.lib LIBRARY c32.lib -LIBRARY cone.lib LIBRARY efsrv.lib LIBRARY esock.lib LIBRARY euser.lib diff -r ccab7f1f8266 -r 67c6ff54ec25 hti/HtiFramework/inc/HtiDispatcher.h --- a/hti/HtiFramework/inc/HtiDispatcher.h Mon May 03 13:58:41 2010 +0300 +++ b/hti/HtiFramework/inc/HtiDispatcher.h Fri May 14 17:25:03 2010 +0300 @@ -480,6 +480,12 @@ * If the period is 0, reconnect would not happen. */ TInt iReconnectDelay; + + /** + * Indicates reboot reason. + * Reason type is defined in enum RStarterSession::TResetReason value in starterclient.h + */ + TInt iRebootReason; }; diff -r ccab7f1f8266 -r 67c6ff54ec25 hti/HtiFramework/inc/HtiMessage.h --- a/hti/HtiFramework/inc/HtiMessage.h Mon May 03 13:58:41 2010 +0300 +++ b/hti/HtiFramework/inc/HtiMessage.h Fri May 14 17:25:03 2010 +0300 @@ -28,7 +28,7 @@ const TInt KHtiMsgServiceUidLen = 4; -class CHtiMessage : public CBase +NONSHARABLE_CLASS(CHtiMessage) : public CBase { public: /** diff -r ccab7f1f8266 -r 67c6ff54ec25 hti/HtiFramework/inc/HtiMessageQueue.h --- a/hti/HtiFramework/inc/HtiMessageQueue.h Mon May 03 13:58:41 2010 +0300 +++ b/hti/HtiFramework/inc/HtiMessageQueue.h Fri May 14 17:25:03 2010 +0300 @@ -23,7 +23,7 @@ #include "HtiMessage.h" -class CHtiMessageQueue : public CBase +NONSHARABLE_CLASS(CHtiMessageQueue) : public CBase { public: /** diff -r ccab7f1f8266 -r 67c6ff54ec25 hti/HtiFramework/src/HtiDispatcher.cpp --- a/hti/HtiFramework/src/HtiDispatcher.cpp Mon May 03 13:58:41 2010 +0300 +++ b/hti/HtiFramework/src/HtiDispatcher.cpp Fri May 14 17:25:03 2010 +0300 @@ -123,7 +123,8 @@ iIdleOverCommAdapter( EFalse ), iHtiInstanceId( 0 ), iShowErrorDialogs( aShowErrorDialogs ), - iReconnectDelay (aReconnectDelay) + iReconnectDelay(aReconnectDelay), + iRebootReason(0) { HTI_LOG_FORMAT( "MaxQueueMemorySize %d", iMaxQueueMemorySize ); iQueueSizeLowThresold = ( iMaxQueueMemorySize / 2 ) / 2; @@ -861,7 +862,23 @@ break; case EHtiReboot: + { + if(aMessage.Length() == 2) + { + iRebootReason = aMessage[1]; + } + else if(aMessage.Length() == 1) + { + iRebootReason = 0; + } + else + { + User::LeaveIfError(DispatchOutgoingErrorMessage( KErrArgument, + KErrDescrInvalidParameter, + KHtiSystemServiceUid ) ); + } ShutdownAndRebootDeviceL(); + } break; case EHtiStop: @@ -1022,7 +1039,16 @@ TInt err = KErrNone; RProcess rebootProcess; // First try the UI layer rebooter - err = rebootProcess.Create( KHtiDeviceRebootExeUI, KNullDesC ); + if(iRebootReason == 0) + { + err = rebootProcess.Create( KHtiDeviceRebootExeUI, KNullDesC ); + } + else + { + TBuf<8> reasonNumber; + reasonNumber.Num(iRebootReason); + err = rebootProcess.Create( KHtiDeviceRebootExeUI, reasonNumber ); + } if ( err != KErrNone ) { HTI_LOG_FORMAT( "UI layer rebooter failed with %d", err ); diff -r ccab7f1f8266 -r 67c6ff54ec25 hti/hti_plat/hti_api/inc/HtiVersion.h --- a/hti/hti_plat/hti_api/inc/HtiVersion.h Mon May 03 13:58:41 2010 +0300 +++ b/hti/hti_plat/hti_api/inc/HtiVersion.h Fri May 14 17:25:03 2010 +0300 @@ -25,13 +25,13 @@ // CONSTANTS const TUint8 KHtiVersionMajor = 2; -const TUint8 KHtiVersionMinor = 18; +const TUint8 KHtiVersionMinor = 21; const TUint8 KHtiVersionBuild = 0; const TUint16 KHtiVersionYear = 2010; -const TUint8 KHtiVersionMonth = 3; -const TUint8 KHtiVersionWeek = 9; -const TUint8 KHtiVersionDay = 5; +const TUint8 KHtiVersionMonth = 4; +const TUint8 KHtiVersionWeek = 15; +const TUint8 KHtiVersionDay = 16; // MACROS diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/Driver/Kernel/Source/SubChannels/MemSpyDriverLogChanHeapBase.cpp --- a/memspy/Driver/Kernel/Source/SubChannels/MemSpyDriverLogChanHeapBase.cpp Mon May 03 13:58:41 2010 +0300 +++ b/memspy/Driver/Kernel/Source/SubChannels/MemSpyDriverLogChanHeapBase.cpp Fri May 14 17:25:03 2010 +0300 @@ -905,7 +905,7 @@ // Finalise construction of heap if ( kernelHeap != NULL ) { - TRACE_KH( Kern::Printf( "DMemSpyDriverLogChanHeapBase::OpenKernelHeap - kernelHeap->Base(): 0x%08x, kernelHeapChunk->Base(): 0x%08x", kernelHeap->Base(), kernelHeapChunk->Base() ) ); + //TRACE_KH( Kern::Printf( "DMemSpyDriverLogChanHeapBase::OpenKernelHeap - kernelHeap->Base(): 0x%08x, kernelHeapChunk->Base(): 0x%08x", kernelHeap->Base(), kernelHeapChunk->Base() ) ); aHeap = kernelHeap; aChunk = kernelHeapChunk; @@ -1017,7 +1017,7 @@ NKern::LockSystem(); const TUint32 copyLength = heapSize; // TODO Min( heap->Size(), heapSize ); - TRACE_KH( Kern::Printf("DMemSpyDriverLogChanHeapBase::OpenKernelHeap(CP) - trying to copy %d (vs orig estimate of %d) bytes from kernel allocator address: 0x%08x", copyLength, heapSize, heap->Base() )); + //TRACE_KH( Kern::Printf("DMemSpyDriverLogChanHeapBase::OpenKernelHeap(CP) - trying to copy %d (vs orig estimate of %d) bytes from kernel allocator address: 0x%08x", copyLength, heapSize, heap->Base() )); memcpy( (TUint8*) heapCopyChunkAddress, heap, copyLength ); NKern::UnlockSystem(); diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/Engine/BWINS/MemSpyEngineu.def --- a/memspy/Engine/BWINS/MemSpyEngineu.def Mon May 03 13:58:41 2010 +0300 +++ b/memspy/Engine/BWINS/MemSpyEngineu.def Fri May 14 17:25:03 2010 +0300 @@ -384,24 +384,31 @@ ?Type@CMemSpyThreadInfoItemBase@@QBE?AW4TMemSpyThreadInfoItemType@@XZ @ 383 NONAME ; enum TMemSpyThreadInfoItemType CMemSpyThreadInfoItemBase::Type(void) const ?TypeAsString@CMemSpyEngineGenericKernelObjectList@@SA?AVTPtrC16@@W4TMemSpyDriverContainerType@@@Z @ 384 NONAME ; class TPtrC16 CMemSpyEngineGenericKernelObjectList::TypeAsString(enum TMemSpyDriverContainerType) ?VID@CMemSpyProcess@@QBEKXZ @ 385 NONAME ; unsigned long CMemSpyProcess::VID(void) const - ?MdcaCount@CMemSpyEngineWindowGroupList@@UBEHXZ @ 386 NONAME ABSENT ; int CMemSpyEngineWindowGroupList::MdcaCount(void) const - ?GetWindowGroupListL@CMemSpyEngineHelperWindowServer@@QAEXAAV?$RArray@VTMemSpyEngineWindowGroupInfo@@@@@Z @ 387 NONAME ABSENT ; void CMemSpyEngineHelperWindowServer::GetWindowGroupListL(class RArray &) - ??1CMemSpyEngineWindowGroupList@@UAE@XZ @ 388 NONAME ABSENT ; CMemSpyEngineWindowGroupList::~CMemSpyEngineWindowGroupList(void) - ?Count@CMemSpyEngineWindowGroupList@@QBEHXZ @ 389 NONAME ABSENT ; int CMemSpyEngineWindowGroupList::Count(void) const - ?ItemIndex@CMemSpyEngineWindowGroupList@@QBEHABVTMemSpyEngineWindowGroupInfo@@@Z @ 390 NONAME ABSENT ; int CMemSpyEngineWindowGroupList::ItemIndex(class TMemSpyEngineWindowGroupInfo const &) const - ?WindowGroupListL@CMemSpyEngineHelperWindowServer@@QAEPAVCMemSpyEngineWindowGroupList@@XZ @ 391 NONAME ABSENT ; class CMemSpyEngineWindowGroupList * CMemSpyEngineHelperWindowServer::WindowGroupListL(void) - ?HelperWindowServer@CMemSpyEngine@@QAEAAVCMemSpyEngineHelperWindowServer@@XZ @ 392 NONAME ABSENT ; class CMemSpyEngineHelperWindowServer & CMemSpyEngine::HelperWindowServer(void) - ?MdcaPoint@CMemSpyEngineWindowGroupList@@UBE?AVTPtrC16@@H@Z @ 393 NONAME ABSENT ; class TPtrC16 CMemSpyEngineWindowGroupList::MdcaPoint(int) const - ?At@CMemSpyEngineWindowGroupList@@QBEABVTMemSpyEngineWindowGroupInfo@@H@Z @ 394 NONAME ABSENT ; class TMemSpyEngineWindowGroupInfo const & CMemSpyEngineWindowGroupList::At(int) const - ?ItemIndex@CMemSpyEngineWindowGroupList@@QBEHABVTMemSpyEngineWindowGroupBasicInfo@@@Z @ 395 NONAME ABSENT ; int CMemSpyEngineWindowGroupList::ItemIndex(class TMemSpyEngineWindowGroupBasicInfo const &) const - ?At@CMemSpyEngineWindowGroupList@@QBEABVTMemSpyEngineWindowGroupBasicInfo@@H@Z @ 396 NONAME ABSENT ; class TMemSpyEngineWindowGroupBasicInfo const & CMemSpyEngineWindowGroupList::At(int) const - ?GetWindowGroupListL@CMemSpyEngineHelperWindowServer@@QAEXAAV?$RArray@VTMemSpyEngineWindowGroupBasicInfo@@@@@Z @ 397 NONAME ABSENT ; void CMemSpyEngineHelperWindowServer::GetWindowGroupListL(class RArray &) - ?GetWindowGroupDetailsL@CMemSpyEngineHelperWindowServer@@QAEXHAAVTMemSpyEngineWindowGroupDetails@@@Z @ 398 NONAME ABSENT ; void CMemSpyEngineHelperWindowServer::GetWindowGroupDetailsL(int, class TMemSpyEngineWindowGroupDetails &) - ?SwitchToL@CMemSpyEngineHelperWindowServer@@QAEXH@Z @ 399 NONAME ABSENT ; void CMemSpyEngineHelperWindowServer::SwitchToL(int) + __E32Dll @ 386 NONAME ABSENT ; int CMemSpyEngineWindowGroupList::MdcaCount(void) const + __E32Dll @ 387 NONAME ABSENT ; void CMemSpyEngineHelperWindowServer::GetWindowGroupListL(class RArray &) + __E32Dll @ 388 NONAME ABSENT ; CMemSpyEngineWindowGroupList::~CMemSpyEngineWindowGroupList(void) + __E32Dll @ 389 NONAME ABSENT ; int CMemSpyEngineWindowGroupList::Count(void) const + __E32Dll @ 390 NONAME ABSENT ; int CMemSpyEngineWindowGroupList::ItemIndex(class TMemSpyEngineWindowGroupInfo const &) const + __E32Dll @ 391 NONAME ABSENT ; class CMemSpyEngineWindowGroupList * CMemSpyEngineHelperWindowServer::WindowGroupListL(void) + __E32Dll @ 392 NONAME ABSENT ; class CMemSpyEngineHelperWindowServer & CMemSpyEngine::HelperWindowServer(void) + __E32Dll @ 393 NONAME ABSENT ; class TPtrC16 CMemSpyEngineWindowGroupList::MdcaPoint(int) const + __E32Dll @ 394 NONAME ABSENT ; class TMemSpyEngineWindowGroupInfo const & CMemSpyEngineWindowGroupList::At(int) const + __E32Dll @ 395 NONAME ABSENT ; int CMemSpyEngineWindowGroupList::ItemIndex(class TMemSpyEngineWindowGroupBasicInfo const &) const + __E32Dll @ 396 NONAME ABSENT ; class TMemSpyEngineWindowGroupBasicInfo const & CMemSpyEngineWindowGroupList::At(int) const + __E32Dll @ 397 NONAME ABSENT ; void CMemSpyEngineHelperWindowServer::GetWindowGroupListL(class RArray &) + __E32Dll @ 398 NONAME ABSENT ; void CMemSpyEngineHelperWindowServer::GetWindowGroupDetailsL(int, class TMemSpyEngineWindowGroupDetails &) + __E32Dll @ 399 NONAME ABSENT ; void CMemSpyEngineHelperWindowServer::SwitchToL(int) ?Capabilities@CMemSpyProcess@@QBE?AUSCapabilitySet@@XZ @ 400 NONAME ; struct SCapabilitySet CMemSpyProcess::Capabilities(void) const ?UIDs@CMemSpyProcess@@QBE?AVTUidType@@XZ @ 401 NONAME ; class TUidType CMemSpyProcess::UIDs(void) const ?HelperCondVar@CMemSpyEngine@@QAEAAVCMemSpyEngineHelperCondVar@@XZ @ 402 NONAME ; class CMemSpyEngineHelperCondVar & CMemSpyEngine::HelperCondVar(void) ?GetCondVarSuspendedThreadsL@CMemSpyEngineHelperCondVar@@QAEXABVTMemSpyDriverHandleInfoGeneric@@AAV?$RArray@VTMemSpyDriverCondVarSuspendedThreadInfo@@@@@Z @ 403 NONAME ; void CMemSpyEngineHelperCondVar::GetCondVarSuspendedThreadsL(class TMemSpyDriverHandleInfoGeneric const &, class RArray &) ?HelperWindowServer@CMemSpyEngine@@QAEAAVMMemSpyEngineHelperWindowServer@@XZ @ 404 NONAME ; class MMemSpyEngineHelperWindowServer & CMemSpyEngine::HelperWindowServer(void) ?IsHelperWindowServerSupported@CMemSpyEngine@@QAEHXZ @ 405 NONAME ; int CMemSpyEngine::IsHelperWindowServerSupported(void) + __E32Dll @ 406 NONAME ABSENT ; int CMemSpyEngineGenericKernelObjectList::Size(void) const + __E32Dll @ 407 NONAME ABSENT ; int CMemSpyEngineGenericKernelObjectList::Size(void) + ?Size@CMemSpyEngineGenericKernelObjectList@@QBEHXZ @ 408 NONAME ; int CMemSpyEngineGenericKernelObjectList::Size(void) const + ?NewHeapRawInfo@CMemSpyEngineHelperHeap@@QAEAAVTMemSpyHeapData@@ABVTMemSpyHeapInfo@@@Z @ 409 NONAME ABSENT ; class TMemSpyHeapData & CMemSpyEngineHelperHeap::NewHeapRawInfo(class TMemSpyHeapInfo const &) + ?NewHeapRawInfo@CMemSpyEngineHelperHeap@@QAE?AVTMemSpyHeapData@@ABVTMemSpyHeapInfo@@@Z @ 410 NONAME ; class TMemSpyHeapData CMemSpyEngineHelperHeap::NewHeapRawInfo(class TMemSpyHeapInfo const &) + ?ItemsCount@CMemSpyEngineGenericKernelObjectList@@QBEHXZ @ 411 NONAME ; int CMemSpyEngineGenericKernelObjectList::ItemsCount(void) const + ?Priority@CMemSpyThread@@QBE?AW4TThreadPriority@@XZ @ 412 NONAME ; enum TThreadPriority CMemSpyThread::Priority(void) const diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/Engine/Source/Helpers/MemSpyEngineHelperHeap.cpp --- a/memspy/Engine/Source/Helpers/MemSpyEngineHelperHeap.cpp Mon May 03 13:58:41 2010 +0300 +++ b/memspy/Engine/Source/Helpers/MemSpyEngineHelperHeap.cpp Fri May 14 17:25:03 2010 +0300 @@ -899,6 +899,55 @@ } +//cigasto: not formatted - raw heap info +EXPORT_C TMemSpyHeapData CMemSpyEngineHelperHeap::NewHeapRawInfo( const TMemSpyHeapInfo& aInfo ) + { + TMemSpyHeapData list; + + // Heap type + if ( aInfo.Type() == TMemSpyHeapInfo::ETypeUnknown ) + { + _LIT( KItem0_Type_Unknown, "Unknown" ); + list.iType.Append( KItem0_Type_Unknown ); + } + else if ( aInfo.Type() == TMemSpyHeapInfo::ETypeRHeap ) + { + const TMemSpyHeapInfoRHeap& rHeap = aInfo.AsRHeap(); + const TMemSpyHeapMetaDataRHeap& metaData = rHeap.MetaData(); + const TMemSpyHeapObjectDataRHeap& objectData = rHeap.ObjectData(); + const TMemSpyHeapStatisticsRHeap& statistics = rHeap.Statistics(); + + _LIT( KItem0_Type_RHeap, "RHeap" ); + list.iType.Append( KItem0_Type_RHeap ); + + // Heap size is the size of the heap minus the size of the embedded (in-place) RHeap. + list.iSize = objectData.Size(); + list.iBaseAddress = (TUint) objectData.Base(); + list.iShared = metaData.IsSharedHeap(); + list.iChunkSize = metaData.ChunkSize(); + list.iAllocationsCount = statistics.StatsAllocated().TypeCount(); + list.iFreeCount = statistics.StatsFree().TypeCount(); + list.iBiggestAllocation = statistics.StatsAllocated().LargestCellSize(); + list.iBiggestFree = statistics.StatsFree().LargestCellSize(); + list.iTotalAllocations = statistics.StatsAllocated().TypeSize(); + list.iTotalFree = statistics.StatsFree().TypeSize(); + list.iSlackFreeSpace = statistics.StatsFree().SlackSpaceCellSize(); + list.iFragmentation = statistics.StatsFree().TypeSize() - statistics.StatsFree().SlackSpaceCellSize(); //to calculate percentage value use iSize as 100% value + list.iHeaderSizeA = metaData.HeaderSizeAllocated(); + list.iHeaderSizeF = metaData.HeaderSizeFree(); + TInt allocOverhead = metaData.HeaderSizeAllocated() * statistics.StatsAllocated().TypeCount(); + list.iAllocationOverhead = allocOverhead; + TInt freeOverhead = metaData.HeaderSizeFree() * statistics.StatsFree().TypeCount(); + list.iFreeOverhead = freeOverhead; + list.iTotalOverhead = freeOverhead + allocOverhead; + list.iOverhead = freeOverhead + allocOverhead; //to calculate percentage value use iSize as 100% value + list.iMinLength = objectData.iMinLength; + list.iMaxLength = objectData.iMaxLength; + list.iDebugAllocatorLibrary = metaData.IsDebugAllocator(); + } + + return list; + } diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/Engine/Source/Helpers/MemSpyEngineHelperKernelContainers.cpp --- a/memspy/Engine/Source/Helpers/MemSpyEngineHelperKernelContainers.cpp Mon May 03 13:58:41 2010 +0300 +++ b/memspy/Engine/Source/Helpers/MemSpyEngineHelperKernelContainers.cpp Fri May 14 17:25:03 2010 +0300 @@ -76,7 +76,7 @@ { CMemSpyEngineGenericKernelObjectContainer* container = CMemSpyEngineGenericKernelObjectContainer::NewLC(); // - for( TInt i=EMemSpyDriverContainerTypeFirst; i<=EMemSpyDriverContainerTypeLast; i++ ) + for( TInt i=EMemSpyDriverContainerTypeFirst; i<=EMemSpyDriverContainerTypeChunk; i++ ) //EMemSpyDriverContainerTypeLast { const TMemSpyDriverContainerType type = static_cast< TMemSpyDriverContainerType >( i ); // @@ -247,6 +247,16 @@ { return iType; } + +EXPORT_C TInt CMemSpyEngineGenericKernelObjectList::Size() const + { + return iSize; + } + +EXPORT_C TInt CMemSpyEngineGenericKernelObjectList::ItemsCount() const + { + return iItems.Count(); + } EXPORT_C TPtrC CMemSpyEngineGenericKernelObjectList::TypeAsString( TMemSpyDriverContainerType aType ) @@ -392,7 +402,7 @@ AddItemL( aItem.iHandle ); iItems.AppendL( aItem ); // - UpdateNameL(); + //UpdateNameL(); } diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/Engine/Source/MemSpyEngineImp.cpp --- a/memspy/Engine/Source/MemSpyEngineImp.cpp Mon May 03 13:58:41 2010 +0300 +++ b/memspy/Engine/Source/MemSpyEngineImp.cpp Fri May 14 17:25:03 2010 +0300 @@ -74,7 +74,7 @@ RDebug::Printf( "CMemSpyEngineImp::~CMemSpyEngineImp() - deleting helpers..." ); #endif delete iHelperSysMemTracker; - delete iServer; + //delete iServer; delete iHelperKernelContainers; delete iHelperFbServ; delete iHelperHeap; @@ -138,7 +138,7 @@ // Starting the server before the driver connection is made // ensures that only one instance of MemSpy can run (either the S60 // UI or the console UI ). - iServer = CMemSpyEngineServer::NewL( iEngine ); + // DONE: MK: Removing server from engine. iServer = CMemSpyEngineServer::NewL( iEngine ); // iMemSpyDriver = new(ELeave) RMemSpyDriverClient(); const TInt error = Driver().Open(); diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/Engine/Source/ThreadAndProcess/MemSpyEngineObjectThread.cpp --- a/memspy/Engine/Source/ThreadAndProcess/MemSpyEngineObjectThread.cpp Mon May 03 13:58:41 2010 +0300 +++ b/memspy/Engine/Source/ThreadAndProcess/MemSpyEngineObjectThread.cpp Fri May 14 17:25:03 2010 +0300 @@ -387,6 +387,11 @@ return isDead; } +EXPORT_C TThreadPriority CMemSpyThread::Priority() const + { + return iPriority; + } + void CMemSpyThread::RefreshL() { diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/Engine/eabi/MemSpyEngineu.def --- a/memspy/Engine/eabi/MemSpyEngineu.def Mon May 03 13:58:41 2010 +0300 +++ b/memspy/Engine/eabi/MemSpyEngineu.def Fri May 14 17:25:03 2010 +0300 @@ -536,4 +536,8 @@ _ZTI49CMemSpyEngineHelperSysMemTrackerEntryWindowServer @ 535 NONAME ; ## _ZTV49CMemSpyEngineHelperSysMemTrackerEntryWindowServer @ 536 NONAME ; ## _ZN13CMemSpyEngine29IsHelperWindowServerSupportedEv @ 537 NONAME + _ZN23CMemSpyEngineHelperHeap14NewHeapRawInfoERK15TMemSpyHeapInfo @ 538 NONAME + _ZNK36CMemSpyEngineGenericKernelObjectList10ItemsCountEv @ 539 NONAME + _ZNK36CMemSpyEngineGenericKernelObjectList4SizeEv @ 540 NONAME + _ZNK13CMemSpyThread8PriorityEv @ 541 NONAME diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/MemSpyClient/bwins/MemSpyClientu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/memspy/MemSpyClient/bwins/MemSpyClientu.def Fri May 14 17:25:03 2010 +0300 @@ -0,0 +1,114 @@ +EXPORTS + ?CpuUse@CMemSpyApiThread@@QBEHXZ @ 1 NONAME ; int CMemSpyApiThread::CpuUse(void) const + ?Name@CMemSpyApiKernelObjectItem@@QBEABVTDesC8@@XZ @ 2 NONAME ; class TDesC8 const & CMemSpyApiKernelObjectItem::Name(void) const + ?AccessCount@CMemSpyApiKernelObjectItem@@QBEHXZ @ 3 NONAME ; int CMemSpyApiKernelObjectItem::AccessCount(void) const + ?TotalOverhead@CMemSpyApiHeap@@QAEHXZ @ 4 NONAME ; int CMemSpyApiHeap::TotalOverhead(void) + ?UniqueID@CMemSpyApiKernelObjectItem@@QBEHXZ @ 5 NONAME ; int CMemSpyApiKernelObjectItem::UniqueID(void) const + ?SessionType@CMemSpyApiKernelObjectItem@@QBE?AW4TIpcSessionType@@XZ @ 6 NONAME ; enum TIpcSessionType CMemSpyApiKernelObjectItem::SessionType(void) const + ?VID@CMemSpyApiThread@@QBEHXZ @ 7 NONAME ; int CMemSpyApiThread::VID(void) const + ?MaxLength@CMemSpyApiHeap@@QAEHXZ @ 8 NONAME ; int CMemSpyApiHeap::MaxLength(void) + ?ProcessNumberUsing@CMemSpyApiThread@@QBEHXZ @ 9 NONAME ; int CMemSpyApiThread::ProcessNumberUsing(void) const + ?AddressOfKernelOwner@CMemSpyApiKernelObjectItem@@QAEPAEXZ @ 10 NONAME ; unsigned char * CMemSpyApiKernelObjectItem::AddressOfKernelOwner(void) + ?FreeCount@CMemSpyApiHeap@@QAEHXZ @ 11 NONAME ; int CMemSpyApiHeap::FreeCount(void) + ?ExitType@CMemSpyApiProcess@@QBE?AW4TExitType@@XZ @ 12 NONAME ; enum TExitType CMemSpyApiProcess::ExitType(void) const + ?TotalFree@CMemSpyApiHeap@@QAEHXZ @ 13 NONAME ; int CMemSpyApiHeap::TotalFree(void) + ?SwitchToThread@RMemSpySession@@QAEHVTThreadId@@H@Z @ 14 NONAME ; int RMemSpySession::SwitchToThread(class TThreadId, int) + ?FreeOverhead@CMemSpyApiHeap@@QAEHXZ @ 15 NONAME ; int CMemSpyApiHeap::FreeOverhead(void) + ?SlackFreeSpace@CMemSpyApiHeap@@QAEHXZ @ 16 NONAME ; int CMemSpyApiHeap::SlackFreeSpace(void) + ?Priority@CMemSpyApiKernelObjectItem@@QBEHXZ @ 17 NONAME ; int CMemSpyApiKernelObjectItem::Priority(void) const + ?EndThread@RMemSpySession@@QAEHVTThreadId@@W4TEndType@@@Z @ 18 NONAME ; int RMemSpySession::EndThread(class TThreadId, enum TEndType) + ?ThreadCount@CMemSpyApiProcess@@QBEHXZ @ 19 NONAME ; int CMemSpyApiProcess::ThreadCount(void) const + ?RequestCount@CMemSpyApiThread@@QBEHXZ @ 20 NONAME ; int CMemSpyApiThread::RequestCount(void) const + ??1CMemSpyApiProcess@@QAE@XZ @ 21 NONAME ; CMemSpyApiProcess::~CMemSpyApiProcess(void) + ?SetThreadPriorityL@RMemSpySession@@QAEXVTThreadId@@H@Z @ 22 NONAME ; void RMemSpySession::SetThreadPriorityL(class TThreadId, int) + ?MinLength@CMemSpyApiHeap@@QAEHXZ @ 23 NONAME ; int CMemSpyApiHeap::MinLength(void) + ?Restrictions@CMemSpyApiKernelObjectItem@@QBEIXZ @ 24 NONAME ; unsigned int CMemSpyApiKernelObjectItem::Restrictions(void) const + ?Id@CMemSpyApiKernelObjectItem@@QBEHXZ @ 25 NONAME ; int CMemSpyApiKernelObjectItem::Id(void) const + ?Count@CMemSpyApiKernelObjectItem@@QBEHXZ @ 26 NONAME ; int CMemSpyApiKernelObjectItem::Count(void) const + ?ExitCategory@CMemSpyApiProcess@@QBE?AV?$TBuf@$0BA@@@XZ @ 27 NONAME ; class TBuf<16> CMemSpyApiProcess::ExitCategory(void) const + ?ControllingOwner@CMemSpyApiKernelObjectItem@@QBEIXZ @ 28 NONAME ; unsigned int CMemSpyApiKernelObjectItem::ControllingOwner(void) const + ?Count@CMemSpyApiKernelObject@@QBEHXZ @ 29 NONAME ; int CMemSpyApiKernelObject::Count(void) const + ?StartPos@CMemSpyApiKernelObjectItem@@QBEHXZ @ 30 NONAME ; int CMemSpyApiKernelObjectItem::StartPos(void) const + ?TimerState@CMemSpyApiKernelObjectItem@@QBE?AW4TMemSpyDriverTimerState@@XZ @ 31 NONAME ; enum TMemSpyDriverTimerState CMemSpyApiKernelObjectItem::TimerState(void) const + ?ExitType@CMemSpyApiThread@@QBE?AW4TExitType@@XZ @ 32 NONAME ; enum TExitType CMemSpyApiThread::ExitType(void) const + ?BaseAddress@CMemSpyApiHeap@@QAEHXZ @ 33 NONAME ; int CMemSpyApiHeap::BaseAddress(void) + ?Version@CMemSpyApiKernelObjectItem@@QBE?AVTVersion@@XZ @ 34 NONAME ; class TVersion CMemSpyApiKernelObjectItem::Version(void) const + ?SwitchToProcess@RMemSpySession@@QAEHVTProcessId@@H@Z @ 35 NONAME ; int RMemSpySession::SwitchToProcess(class TProcessId, int) + ?MaxSize@CMemSpyApiKernelObjectItem@@QBEHXZ @ 36 NONAME ; int CMemSpyApiKernelObjectItem::MaxSize(void) const + ?Type@CMemSpyApiHeap@@QAEAAVTDesC16@@XZ @ 37 NONAME ; class TDesC16 & CMemSpyApiHeap::Type(void) + ?AddressOfOwningProcess@CMemSpyApiKernelObjectItem@@QAEPAEXZ @ 38 NONAME ; unsigned char * CMemSpyApiKernelObjectItem::AddressOfOwningProcess(void) + ?Id@CMemSpyApiProcess@@QBE?AVTProcessId@@XZ @ 39 NONAME ; class TProcessId CMemSpyApiProcess::Id(void) const + ??1CMemSpyApiKernelObjectItem@@QAE@XZ @ 40 NONAME ; CMemSpyApiKernelObjectItem::~CMemSpyApiKernelObjectItem(void) + ?BiggestAllocation@CMemSpyApiHeap@@QAEHXZ @ 41 NONAME ; int CMemSpyApiHeap::BiggestAllocation(void) + ?ExitReason@CMemSpyApiProcess@@QBEHXZ @ 42 NONAME ; int CMemSpyApiProcess::ExitReason(void) const + ?MsgCount@CMemSpyApiKernelObjectItem@@QBEHXZ @ 43 NONAME ; int CMemSpyApiKernelObjectItem::MsgCount(void) const + ?AllocationsCount@CMemSpyApiHeap@@QAEHXZ @ 44 NONAME ; int CMemSpyApiHeap::AllocationsCount(void) + ?AllocationOverhead@CMemSpyApiHeap@@QAEHXZ @ 45 NONAME ; int CMemSpyApiHeap::AllocationOverhead(void) + ?NameOfOwner@CMemSpyApiKernelObjectItem@@QBEABVTDesC8@@XZ @ 46 NONAME ; class TDesC8 const & CMemSpyApiKernelObjectItem::NameOfOwner(void) const + ?WaitCount@CMemSpyApiKernelObjectItem@@QBEHXZ @ 47 NONAME ; int CMemSpyApiKernelObjectItem::WaitCount(void) const + ?ThreadSystemPermanentOrCritical@RMemSpySession@@QAEHVTThreadId@@H@Z @ 48 NONAME ; int RMemSpySession::ThreadSystemPermanentOrCritical(class TThreadId, int) + ?Protection@CMemSpyApiKernelObjectItem@@QBEIXZ @ 49 NONAME ; unsigned int CMemSpyApiKernelObjectItem::Protection(void) const + ?Attributes@CMemSpyApiThread@@QBEHXZ @ 50 NONAME ; int CMemSpyApiThread::Attributes(void) const + ?BiggestFree@CMemSpyApiHeap@@QAEHXZ @ 51 NONAME ; int CMemSpyApiHeap::BiggestFree(void) + ?Bottom@CMemSpyApiKernelObjectItem@@QBEHXZ @ 52 NONAME ; int CMemSpyApiKernelObjectItem::Bottom(void) const + ?Size@CMemSpyApiKernelObject@@QBE_JXZ @ 53 NONAME ; long long CMemSpyApiKernelObject::Size(void) const + ?ThreadHandles@CMemSpyApiThread@@QBEHXZ @ 54 NONAME ; int CMemSpyApiThread::ThreadHandles(void) const + ?SvrSessionType@CMemSpyApiKernelObjectItem@@QBEEXZ @ 55 NONAME ; unsigned char CMemSpyApiKernelObjectItem::SvrSessionType(void) const + ?TotalAllocations@CMemSpyApiHeap@@QAEHXZ @ 56 NONAME ; int CMemSpyApiHeap::TotalAllocations(void) + ?Name@CMemSpyApiProcess@@QBEABVTDesC16@@XZ @ 57 NONAME ; class TDesC16 const & CMemSpyApiProcess::Name(void) const + ?ChunkType@CMemSpyApiKernelObjectItem@@QBEIXZ @ 58 NONAME ; unsigned int CMemSpyApiKernelObjectItem::ChunkType(void) const + ?GetKernelObjects@RMemSpySession@@QAEHAAV?$RArray@PAVCMemSpyApiKernelObject@@@@@Z @ 59 NONAME ; int RMemSpySession::GetKernelObjects(class RArray &) + ?HeaderSizeF@CMemSpyApiHeap@@QAEHXZ @ 60 NONAME ; int CMemSpyApiHeap::HeaderSizeF(void) + ?Id@CMemSpyApiThread@@QBE?AVTThreadId@@XZ @ 61 NONAME ; class TThreadId CMemSpyApiThread::Id(void) const + ?MsgLimit@CMemSpyApiKernelObjectItem@@QBEHXZ @ 62 NONAME ; int CMemSpyApiKernelObjectItem::MsgLimit(void) const + ?AddressOfDataBssStackChunk@CMemSpyApiKernelObjectItem@@QAEPAEXZ @ 63 NONAME ; unsigned char * CMemSpyApiKernelObjectItem::AddressOfDataBssStackChunk(void) + ?MapAttr@CMemSpyApiKernelObjectItem@@QBEIXZ @ 64 NONAME ; unsigned int CMemSpyApiKernelObjectItem::MapAttr(void) const + ?Top@CMemSpyApiKernelObjectItem@@QBEHXZ @ 65 NONAME ; int CMemSpyApiKernelObjectItem::Top(void) const + ?Resetting@CMemSpyApiKernelObjectItem@@QBEEXZ @ 66 NONAME ; unsigned char CMemSpyApiKernelObjectItem::Resetting(void) const + ?HeaderSizeA@CMemSpyApiHeap@@QAEHXZ @ 67 NONAME ; int CMemSpyApiHeap::HeaderSizeA(void) + ?EndProcess@RMemSpySession@@QAEHVTProcessId@@W4TEndType@@@Z @ 68 NONAME ; int RMemSpySession::EndProcess(class TProcessId, enum TEndType) + ?AddressOfCodeSeg@CMemSpyApiKernelObjectItem@@QAEPAEXZ @ 69 NONAME ; unsigned char * CMemSpyApiKernelObjectItem::AddressOfCodeSeg(void) + ?TotalAccessCount@CMemSpyApiKernelObjectItem@@QBEGXZ @ 70 NONAME ; unsigned short CMemSpyApiKernelObjectItem::TotalAccessCount(void) const + ?GetThreadsL@RMemSpySession@@QAEXVTProcessId@@AAV?$RArray@PAVCMemSpyApiThread@@@@W4TSortType@@@Z @ 71 NONAME ; void RMemSpySession::GetThreadsL(class TProcessId, class RArray &, enum TSortType) + ?Changes@CMemSpyApiKernelObjectItem@@QBEIXZ @ 72 NONAME ; unsigned int CMemSpyApiKernelObjectItem::Changes(void) const + ?ProcessId@CMemSpyApiThread@@QBE?AVTProcessId@@XZ @ 73 NONAME ; class TProcessId CMemSpyApiThread::ProcessId(void) const + ??0RMemSpySession@@QAE@XZ @ 74 NONAME ; RMemSpySession::RMemSpySession(void) + ?Type@CMemSpyApiKernelObjectItem@@QBE?AW4TMemSpyDriverContainerType@@XZ @ 75 NONAME ; enum TMemSpyDriverContainerType CMemSpyApiKernelObjectItem::Type(void) const + ?AddressOfServer@CMemSpyApiKernelObjectItem@@QAEPAEXZ @ 76 NONAME ; unsigned char * CMemSpyApiKernelObjectItem::AddressOfServer(void) + ?Size@CMemSpyApiHeap@@QAEHXZ @ 77 NONAME ; int CMemSpyApiHeap::Size(void) + ??1CMemSpyApiKernelObject@@QAE@XZ @ 78 NONAME ; CMemSpyApiKernelObject::~CMemSpyApiKernelObject(void) + ??1CMemSpyApiHeap@@QAE@XZ @ 79 NONAME ; CMemSpyApiHeap::~CMemSpyApiHeap(void) + ?ChunkSize@CMemSpyApiHeap@@QAEHXZ @ 80 NONAME ; int CMemSpyApiHeap::ChunkSize(void) + ?UnitsMask@CMemSpyApiKernelObjectItem@@QBEIXZ @ 81 NONAME ; unsigned int CMemSpyApiKernelObjectItem::UnitsMask(void) const + ?Size@CMemSpyApiKernelObjectItem@@QBEKXZ @ 82 NONAME ; unsigned long CMemSpyApiKernelObjectItem::Size(void) const + ?State@CMemSpyApiKernelObjectItem@@QBEEXZ @ 83 NONAME ; unsigned char CMemSpyApiKernelObjectItem::State(void) const + ?Shared@CMemSpyApiHeap@@QAEHXZ @ 84 NONAME ; int CMemSpyApiHeap::Shared(void) + ?Type@CMemSpyApiKernelObject@@QBE?AW4TMemSpyDriverContainerType@@XZ @ 85 NONAME ; enum TMemSpyDriverContainerType CMemSpyApiKernelObject::Type(void) const + ?Fragmentation@CMemSpyApiHeap@@QAEHXZ @ 86 NONAME ; int CMemSpyApiHeap::Fragmentation(void) + ?Name@CMemSpyApiKernelObject@@QBEABVTDesC16@@XZ @ 87 NONAME ; class TDesC16 const & CMemSpyApiKernelObject::Name(void) const + ?TimerType@CMemSpyApiKernelObjectItem@@QBE?AW4TMemSpyDriverTimerType@@XZ @ 88 NONAME ; enum TMemSpyDriverTimerType CMemSpyApiKernelObjectItem::TimerType(void) const + ?ProcessSystemPermanentOrCritical@RMemSpySession@@QAEHVTProcessId@@H@Z @ 89 NONAME ; int RMemSpySession::ProcessSystemPermanentOrCritical(class TProcessId, int) + ?SecurityZone@CMemSpyApiKernelObjectItem@@QBEIXZ @ 90 NONAME ; unsigned int CMemSpyApiKernelObjectItem::SecurityZone(void) const + ?CreatorId@CMemSpyApiKernelObjectItem@@QBEIXZ @ 91 NONAME ; unsigned int CMemSpyApiKernelObjectItem::CreatorId(void) const + ?MapCount@CMemSpyApiKernelObjectItem@@QBEHXZ @ 92 NONAME ; int CMemSpyApiKernelObjectItem::MapCount(void) const + ?NameDetail@CMemSpyApiKernelObjectItem@@QBEABVTDesC8@@XZ @ 93 NONAME ; class TDesC8 const & CMemSpyApiKernelObjectItem::NameDetail(void) const + ?OpenChannels@CMemSpyApiKernelObjectItem@@QAEHXZ @ 94 NONAME ; int CMemSpyApiKernelObjectItem::OpenChannels(void) + ?Order@CMemSpyApiKernelObjectItem@@QBEEXZ @ 95 NONAME ; unsigned char CMemSpyApiKernelObjectItem::Order(void) const + ?ProcessPriority@CMemSpyApiThread@@QBE?AW4TProcessPriority@@XZ @ 96 NONAME ; enum TProcessPriority CMemSpyApiThread::ProcessPriority(void) const + ?GetProcessesL@RMemSpySession@@QAEXAAV?$RArray@PAVCMemSpyApiProcess@@@@W4TSortType@@@Z @ 97 NONAME ; void RMemSpySession::GetProcessesL(class RArray &, enum TSortType) + ?Handle@CMemSpyApiKernelObjectItem@@QBEPAXXZ @ 98 NONAME ; void * CMemSpyApiKernelObjectItem::Handle(void) const + ?ParseMask@CMemSpyApiKernelObjectItem@@QBEIXZ @ 99 NONAME ; unsigned int CMemSpyApiKernelObjectItem::ParseMask(void) const + ?Attributes@CMemSpyApiKernelObjectItem@@QBEHXZ @ 100 NONAME ; int CMemSpyApiKernelObjectItem::Attributes(void) const + ?DebugAllocatorLibrary@CMemSpyApiHeap@@QAEHXZ @ 101 NONAME ; int CMemSpyApiHeap::DebugAllocatorLibrary(void) + ?ThreadNumberUsing@CMemSpyApiThread@@QBEHXZ @ 102 NONAME ; int CMemSpyApiThread::ThreadNumberUsing(void) const + ?Overhead@CMemSpyApiHeap@@QAEHXZ @ 103 NONAME ; int CMemSpyApiHeap::Overhead(void) + ?Connect@RMemSpySession@@QAEHXZ @ 104 NONAME ; int RMemSpySession::Connect(void) + ??1CMemSpyApiThread@@QAE@XZ @ 105 NONAME ; CMemSpyApiThread::~CMemSpyApiThread(void) + ?SID@CMemSpyApiThread@@QBEHXZ @ 106 NONAME ; int CMemSpyApiThread::SID(void) const + ?AddressOfOwningThread@CMemSpyApiKernelObjectItem@@QAEPAEXZ @ 107 NONAME ; unsigned char * CMemSpyApiKernelObjectItem::AddressOfOwningThread(void) + ?GetKernelObjectItems@RMemSpySession@@QAEHAAV?$RArray@PAVCMemSpyApiKernelObjectItem@@@@W4TMemSpyDriverContainerType@@@Z @ 108 NONAME ; int RMemSpySession::GetKernelObjectItems(class RArray &, enum TMemSpyDriverContainerType) + ?ProcessHandles@CMemSpyApiThread@@QBEHXZ @ 109 NONAME ; int CMemSpyApiThread::ProcessHandles(void) const + ?ThreadPriority@CMemSpyApiThread@@QBE?AW4TThreadPriority@@XZ @ 110 NONAME ; enum TThreadPriority CMemSpyApiThread::ThreadPriority(void) const + ?GetHeap@RMemSpySession@@QAEPAVCMemSpyApiHeap@@XZ @ 111 NONAME ; class CMemSpyApiHeap * RMemSpySession::GetHeap(void) + ?Name@CMemSpyApiThread@@QBEABVTDesC16@@XZ @ 112 NONAME ; class TDesC16 const & CMemSpyApiThread::Name(void) const + diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/MemSpyClient/eabi/MemSpyClientu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/memspy/MemSpyClient/eabi/MemSpyClientu.def Fri May 14 17:25:03 2010 +0300 @@ -0,0 +1,120 @@ +EXPORTS + _ZN14CMemSpyApiHeap11BaseAddressEv @ 1 NONAME + _ZN14CMemSpyApiHeap11BiggestFreeEv @ 2 NONAME + _ZN14CMemSpyApiHeap11HeaderSizeAEv @ 3 NONAME + _ZN14CMemSpyApiHeap11HeaderSizeFEv @ 4 NONAME + _ZN14CMemSpyApiHeap12FreeOverheadEv @ 5 NONAME + _ZN14CMemSpyApiHeap13FragmentationEv @ 6 NONAME + _ZN14CMemSpyApiHeap13TotalOverheadEv @ 7 NONAME + _ZN14CMemSpyApiHeap14SlackFreeSpaceEv @ 8 NONAME + _ZN14CMemSpyApiHeap16AllocationsCountEv @ 9 NONAME + _ZN14CMemSpyApiHeap16TotalAllocationsEv @ 10 NONAME + _ZN14CMemSpyApiHeap17BiggestAllocationEv @ 11 NONAME + _ZN14CMemSpyApiHeap18AllocationOverheadEv @ 12 NONAME + _ZN14CMemSpyApiHeap21DebugAllocatorLibraryEv @ 13 NONAME + _ZN14CMemSpyApiHeap4SizeEv @ 14 NONAME + _ZN14CMemSpyApiHeap4TypeEv @ 15 NONAME + _ZN14CMemSpyApiHeap6SharedEv @ 16 NONAME + _ZN14CMemSpyApiHeap8OverheadEv @ 17 NONAME + _ZN14CMemSpyApiHeap9ChunkSizeEv @ 18 NONAME + _ZN14CMemSpyApiHeap9FreeCountEv @ 19 NONAME + _ZN14CMemSpyApiHeap9MaxLengthEv @ 20 NONAME + _ZN14CMemSpyApiHeap9MinLengthEv @ 21 NONAME + _ZN14CMemSpyApiHeap9TotalFreeEv @ 22 NONAME + _ZN14CMemSpyApiHeapD1Ev @ 23 NONAME + _ZN14CMemSpyApiHeapD2Ev @ 24 NONAME + _ZN14RMemSpySession10EndProcessE10TProcessId8TEndType @ 25 NONAME + _ZN14RMemSpySession11GetThreadsLE10TProcessIdR6RArrayIP16CMemSpyApiThreadE9TSortType @ 26 NONAME + _ZN14RMemSpySession13GetProcessesLER6RArrayIP17CMemSpyApiProcessE9TSortType @ 27 NONAME + _ZN14RMemSpySession14SwitchToThreadE9TThreadIdi @ 28 NONAME + _ZN14RMemSpySession15SwitchToProcessE10TProcessIdi @ 29 NONAME + _ZN14RMemSpySession16GetKernelObjectsER6RArrayIP22CMemSpyApiKernelObjectE @ 30 NONAME + _ZN14RMemSpySession20GetKernelObjectItemsER6RArrayIP26CMemSpyApiKernelObjectItemE26TMemSpyDriverContainerType @ 31 NONAME + _ZN14RMemSpySession31ThreadSystemPermanentOrCriticalE9TThreadIdi @ 32 NONAME + _ZN14RMemSpySession32ProcessSystemPermanentOrCriticalE10TProcessIdi @ 33 NONAME + _ZN14RMemSpySession7ConnectEv @ 34 NONAME + _ZN14RMemSpySession7GetHeapEv @ 35 NONAME + _ZN14RMemSpySession9EndThreadE9TThreadId8TEndType @ 36 NONAME + _ZN14RMemSpySessionC1Ev @ 37 NONAME + _ZN14RMemSpySessionC2Ev @ 38 NONAME + _ZN16CMemSpyApiThreadD1Ev @ 39 NONAME + _ZN16CMemSpyApiThreadD2Ev @ 40 NONAME + _ZN17CMemSpyApiProcessD1Ev @ 41 NONAME + _ZN17CMemSpyApiProcessD2Ev @ 42 NONAME + _ZN22CMemSpyApiKernelObjectD1Ev @ 43 NONAME + _ZN22CMemSpyApiKernelObjectD2Ev @ 44 NONAME + _ZN26CMemSpyApiKernelObjectItem12OpenChannelsEv @ 45 NONAME + _ZN26CMemSpyApiKernelObjectItem15AddressOfServerEv @ 46 NONAME + _ZN26CMemSpyApiKernelObjectItem16AddressOfCodeSegEv @ 47 NONAME + _ZN26CMemSpyApiKernelObjectItem20AddressOfKernelOwnerEv @ 48 NONAME + _ZN26CMemSpyApiKernelObjectItem21AddressOfOwningThreadEv @ 49 NONAME + _ZN26CMemSpyApiKernelObjectItem22AddressOfOwningProcessEv @ 50 NONAME + _ZN26CMemSpyApiKernelObjectItem26AddressOfDataBssStackChunkEv @ 51 NONAME + _ZN26CMemSpyApiKernelObjectItemD1Ev @ 52 NONAME + _ZN26CMemSpyApiKernelObjectItemD2Ev @ 53 NONAME + _ZNK16CMemSpyApiThread10AttributesEv @ 54 NONAME + _ZNK16CMemSpyApiThread12RequestCountEv @ 55 NONAME + _ZNK16CMemSpyApiThread13ThreadHandlesEv @ 56 NONAME + _ZNK16CMemSpyApiThread14ProcessHandlesEv @ 57 NONAME + _ZNK16CMemSpyApiThread14ThreadPriorityEv @ 58 NONAME + _ZNK16CMemSpyApiThread15ProcessPriorityEv @ 59 NONAME + _ZNK16CMemSpyApiThread17ThreadNumberUsingEv @ 60 NONAME + _ZNK16CMemSpyApiThread18ProcessNumberUsingEv @ 61 NONAME + _ZNK16CMemSpyApiThread2IdEv @ 62 NONAME + _ZNK16CMemSpyApiThread3SIDEv @ 63 NONAME + _ZNK16CMemSpyApiThread3VIDEv @ 64 NONAME + _ZNK16CMemSpyApiThread4NameEv @ 65 NONAME + _ZNK16CMemSpyApiThread6CpuUseEv @ 66 NONAME + _ZNK16CMemSpyApiThread8ExitTypeEv @ 67 NONAME + _ZNK16CMemSpyApiThread9ProcessIdEv @ 68 NONAME + _ZNK17CMemSpyApiProcess10ExitReasonEv @ 69 NONAME + _ZNK17CMemSpyApiProcess11ThreadCountEv @ 70 NONAME + _ZNK17CMemSpyApiProcess12ExitCategoryEv @ 71 NONAME + _ZNK17CMemSpyApiProcess2IdEv @ 72 NONAME + _ZNK17CMemSpyApiProcess4NameEv @ 73 NONAME + _ZNK17CMemSpyApiProcess8ExitTypeEv @ 74 NONAME + _ZNK22CMemSpyApiKernelObject4NameEv @ 75 NONAME + _ZNK22CMemSpyApiKernelObject4SizeEv @ 76 NONAME + _ZNK22CMemSpyApiKernelObject4TypeEv @ 77 NONAME + _ZNK22CMemSpyApiKernelObject5CountEv @ 78 NONAME + _ZNK26CMemSpyApiKernelObjectItem10AttributesEv @ 79 NONAME + _ZNK26CMemSpyApiKernelObjectItem10NameDetailEv @ 80 NONAME + _ZNK26CMemSpyApiKernelObjectItem10ProtectionEv @ 81 NONAME + _ZNK26CMemSpyApiKernelObjectItem10TimerStateEv @ 82 NONAME + _ZNK26CMemSpyApiKernelObjectItem11AccessCountEv @ 83 NONAME + _ZNK26CMemSpyApiKernelObjectItem11NameOfOwnerEv @ 84 NONAME + _ZNK26CMemSpyApiKernelObjectItem11SessionTypeEv @ 85 NONAME + _ZNK26CMemSpyApiKernelObjectItem12RestrictionsEv @ 86 NONAME + _ZNK26CMemSpyApiKernelObjectItem12SecurityZoneEv @ 87 NONAME + _ZNK26CMemSpyApiKernelObjectItem14SvrSessionTypeEv @ 88 NONAME + _ZNK26CMemSpyApiKernelObjectItem16ControllingOwnerEv @ 89 NONAME + _ZNK26CMemSpyApiKernelObjectItem16TotalAccessCountEv @ 90 NONAME + _ZNK26CMemSpyApiKernelObjectItem2IdEv @ 91 NONAME + _ZNK26CMemSpyApiKernelObjectItem3TopEv @ 92 NONAME + _ZNK26CMemSpyApiKernelObjectItem4NameEv @ 93 NONAME + _ZNK26CMemSpyApiKernelObjectItem4SizeEv @ 94 NONAME + _ZNK26CMemSpyApiKernelObjectItem4TypeEv @ 95 NONAME + _ZNK26CMemSpyApiKernelObjectItem5CountEv @ 96 NONAME + _ZNK26CMemSpyApiKernelObjectItem5OrderEv @ 97 NONAME + _ZNK26CMemSpyApiKernelObjectItem5StateEv @ 98 NONAME + _ZNK26CMemSpyApiKernelObjectItem6BottomEv @ 99 NONAME + _ZNK26CMemSpyApiKernelObjectItem6HandleEv @ 100 NONAME + _ZNK26CMemSpyApiKernelObjectItem7ChangesEv @ 101 NONAME + _ZNK26CMemSpyApiKernelObjectItem7MapAttrEv @ 102 NONAME + _ZNK26CMemSpyApiKernelObjectItem7MaxSizeEv @ 103 NONAME + _ZNK26CMemSpyApiKernelObjectItem7VersionEv @ 104 NONAME + _ZNK26CMemSpyApiKernelObjectItem8MapCountEv @ 105 NONAME + _ZNK26CMemSpyApiKernelObjectItem8MsgCountEv @ 106 NONAME + _ZNK26CMemSpyApiKernelObjectItem8MsgLimitEv @ 107 NONAME + _ZNK26CMemSpyApiKernelObjectItem8PriorityEv @ 108 NONAME + _ZNK26CMemSpyApiKernelObjectItem8StartPosEv @ 109 NONAME + _ZNK26CMemSpyApiKernelObjectItem8UniqueIDEv @ 110 NONAME + _ZNK26CMemSpyApiKernelObjectItem9ChunkTypeEv @ 111 NONAME + _ZNK26CMemSpyApiKernelObjectItem9CreatorIdEv @ 112 NONAME + _ZNK26CMemSpyApiKernelObjectItem9ParseMaskEv @ 113 NONAME + _ZNK26CMemSpyApiKernelObjectItem9ResettingEv @ 114 NONAME + _ZNK26CMemSpyApiKernelObjectItem9TimerTypeEv @ 115 NONAME + _ZNK26CMemSpyApiKernelObjectItem9UnitsMaskEv @ 116 NONAME + _ZNK26CMemSpyApiKernelObjectItem9WaitCountEv @ 117 NONAME + _ZN14RMemSpySession18SetThreadPriorityLE9TThreadIdi @ 118 NONAME + diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/MemSpyClient/group/MemSpyClient.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/memspy/MemSpyClient/group/MemSpyClient.mmp Fri May 14 17:25:03 2010 +0300 @@ -0,0 +1,53 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include + +TARGETTYPE dll +TARGET MemSpyClient.dll +UID 0 0x2002EA8E +VENDORID VID_DEFAULT +SMPSAFE + +CAPABILITY PowerMgmt SwEvent ReadUserData WriteUserData ReadDeviceData WriteDeviceData + +SOURCEPATH ../src +SOURCE memspysession.cpp +SOURCE memspyapiprocess.cpp +SOURCE memspyapikernelobject.cpp +SOURCE memspyapiheap.cpp +SOURCE memspyapikernelobjectitem.cpp memspyapithread.cpp + +USERINCLUDE ../inc + +OS_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY estor.lib +LIBRARY bafl.lib +LIBRARY ws32.lib +LIBRARY cone.lib +LIBRARY eikcore.lib +LIBRARY fbscli.lib +LIBRARY PlatformEnv.lib + +LIBRARY MemSpyEngine.lib + +//EXPORTUNFROZEN \ No newline at end of file diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/MemSpyClient/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/memspy/MemSpyClient/group/bld.inf Fri May 14 17:25:03 2010 +0300 @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include + +PRJ_EXPORTS +// Public API +../inc/memspysession.h OS_LAYER_PLATFORM_EXPORT_PATH(memspysession.h) +../inc/memspyprocessdata.h OS_LAYER_PLATFORM_EXPORT_PATH(memspy/engine/memspyprocessdata.h) +../inc/memspykernelobjectdata.h OS_LAYER_PLATFORM_EXPORT_PATH(memspy/engine/memspykernelobjectdata.h) +../inc/memspyheapdata.h OS_LAYER_PLATFORM_EXPORT_PATH(memspy/engine/memspyheapdata.h) +../inc/memspyapiprocess.h OS_LAYER_PLATFORM_EXPORT_PATH(memspy/api/memspyapiprocess.h) +../inc/memspyapikernelobject.h OS_LAYER_PLATFORM_EXPORT_PATH(memspy/api/memspyapikernelobject.h) +../inc/memspyapikernelobjectitem.h OS_LAYER_PLATFORM_EXPORT_PATH(memspy/api/memspyapikernelobjectitem.h) +../inc/memspyapiheap.h OS_LAYER_PLATFORM_EXPORT_PATH(memspy/api/memspyapiheap.h) +../inc/memspythreaddata.h OS_LAYER_PLATFORM_EXPORT_PATH(memspy/engine/memspythreaddata.h) +../inc/memspyapithread.h OS_LAYER_PLATFORM_EXPORT_PATH(memspy/api/memspyapithread.h) + +PRJ_MMPFILES +MemSpyClient.mmp \ No newline at end of file diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/MemSpyClient/inc/memspyapiheap.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/memspy/MemSpyClient/inc/memspyapiheap.h Fri May 14 17:25:03 2010 +0300 @@ -0,0 +1,69 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Contains the declaration of CMemSpyApiHeap class +*/ + +#ifndef MEMSPYAPIHEAP_H +#define MEMSPYAPIHEAP_H + +// System includes +#include + +class TMemSpyHeapData; + +NONSHARABLE_CLASS( CMemSpyApiHeap ) + { +public: + IMPORT_C ~CMemSpyApiHeap(); + + static CMemSpyApiHeap* NewL(const TMemSpyHeapData& aData); + + static CMemSpyApiHeap* NewLC(const TMemSpyHeapData& aData); + +public: //API + IMPORT_C TDesC& Type(); + IMPORT_C TInt Size(); + IMPORT_C TInt BaseAddress(); + IMPORT_C TBool Shared(); + IMPORT_C TInt ChunkSize(); + IMPORT_C TInt AllocationsCount(); + IMPORT_C TInt FreeCount(); + IMPORT_C TInt BiggestAllocation(); + IMPORT_C TInt BiggestFree(); + IMPORT_C TInt TotalAllocations(); + IMPORT_C TInt TotalFree(); + IMPORT_C TInt SlackFreeSpace(); + IMPORT_C TInt Fragmentation(); // Percentage value, iSize is 100% - value for calculation + IMPORT_C TInt HeaderSizeA(); + IMPORT_C TInt HeaderSizeF(); + IMPORT_C TInt AllocationOverhead(); + IMPORT_C TInt FreeOverhead(); + IMPORT_C TInt TotalOverhead(); + IMPORT_C TInt Overhead(); //Percentage value, iSize is 100% - value for calculation + IMPORT_C TInt MinLength(); + IMPORT_C TInt MaxLength(); + IMPORT_C TBool DebugAllocatorLibrary(); + +private: + CMemSpyApiHeap(); + + void ConstructL(const TMemSpyHeapData& aData); + +private: + TMemSpyHeapData *iHeapData; +}; + + +#endif // MEMSPYAPIHEAP_H diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/MemSpyClient/inc/memspyapikernelobject.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/memspy/MemSpyClient/inc/memspyapikernelobject.h Fri May 14 17:25:03 2010 +0300 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef MEMSPYAPIPKERNELOBJECT_H +#define MEMSPYAPIPKERNELOBJECT_H + +// System includes +#include + +#include + +class TMemSpyKernelObjectData; + +NONSHARABLE_CLASS( CMemSpyApiKernelObject ) + { +public: + IMPORT_C ~CMemSpyApiKernelObject(); + + static CMemSpyApiKernelObject* NewL(const TMemSpyKernelObjectData& aData); + + static CMemSpyApiKernelObject* NewLC(const TMemSpyKernelObjectData& aData); + +public: + IMPORT_C TMemSpyDriverContainerType Type() const; + + IMPORT_C const TDesC& Name() const; + + IMPORT_C TInt Count() const; + + IMPORT_C TInt64 Size() const; + +private: + CMemSpyApiKernelObject(); + + void ConstructL(const TMemSpyKernelObjectData& aData); + +private: + TMemSpyKernelObjectData *iKernelObjectData; +}; + + +#endif // MEMSPYAPIPKERNELOBJECT_H diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/MemSpyClient/inc/memspyapikernelobjectitem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/memspy/MemSpyClient/inc/memspyapikernelobjectitem.h Fri May 14 17:25:03 2010 +0300 @@ -0,0 +1,128 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Contains the declaration of CMemSpyProcess class +*/ + +#ifndef MEMSPYAPIKERNELOBJECTITEM_H +#define MEMSPYAPIKERNELOBJECTITEM_H + +// System includes +#include +#include + +class TMemSpyDriverHandleInfoGeneric; +//class TMemSpyDriverContainerType; +//class TMemSpyDriverTimerType; +//class TMemSpyDriverTimerState; + +NONSHARABLE_CLASS( CMemSpyApiKernelObjectItem ) + { +public: + IMPORT_C ~CMemSpyApiKernelObjectItem(); + + static CMemSpyApiKernelObjectItem* NewL(const TMemSpyDriverHandleInfoGeneric& aData); + + static CMemSpyApiKernelObjectItem* NewLC(const TMemSpyDriverHandleInfoGeneric& aData); + +public: + + IMPORT_C const TDesC8& Name() const; + + IMPORT_C TAny* Handle() const; + + IMPORT_C TMemSpyDriverContainerType Type() const; + + // For Process, thread, chunk (owning process id), server (owning thread id) + IMPORT_C TInt Id() const; + + // For Chunk, Library + IMPORT_C TUint32 Size() const; + + // For Semaphore, Mutex, Server + IMPORT_C TInt Count() const; + + // For Mutex + IMPORT_C TInt WaitCount() const; + + // For Server, Session + IMPORT_C TIpcSessionType SessionType() const; + + // For Timer + IMPORT_C TMemSpyDriverTimerType TimerType() const; + IMPORT_C TMemSpyDriverTimerState TimerState() const; + + // For Logical channel + IMPORT_C TInt OpenChannels(); + + // For most of the object types + IMPORT_C const TDesC8& NameDetail() const; // Name + IMPORT_C TInt AccessCount() const; + IMPORT_C TInt UniqueID() const; + IMPORT_C TUint Protection() const; + IMPORT_C TUint8* AddressOfKernelOwner(); + IMPORT_C TInt Priority() const; + IMPORT_C TUint8* AddressOfOwningProcess(); + IMPORT_C TUint CreatorId() const; + IMPORT_C TUint SecurityZone() const; + IMPORT_C TInt Attributes() const; + IMPORT_C TUint8* AddressOfDataBssStackChunk(); + + // For Server, Session + IMPORT_C TUint8* AddressOfOwningThread(); + IMPORT_C TUint8* AddressOfServer(); + IMPORT_C TUint16 TotalAccessCount() const; + IMPORT_C TUint8 SvrSessionType() const; + IMPORT_C TInt MsgCount() const; + IMPORT_C TInt MsgLimit() const; + + // For chunk + IMPORT_C TInt MaxSize() const; + IMPORT_C TInt Bottom() const; + IMPORT_C TInt Top() const; + IMPORT_C TInt StartPos() const; + IMPORT_C TUint ControllingOwner() const; + IMPORT_C TUint Restrictions() const; + IMPORT_C TUint MapAttr() const; + IMPORT_C TUint ChunkType() const; + IMPORT_C const TDesC8& NameOfOwner() const; // chunk, server + + // For library + IMPORT_C TInt MapCount() const; + IMPORT_C TUint8 State() const; + IMPORT_C TUint8* AddressOfCodeSeg(); + + // Semaphore, mutex, condvar + IMPORT_C TUint8 Resetting() const; + IMPORT_C TUint8 Order() const; + + // For Logical/Physical device + IMPORT_C TVersion Version() const; + IMPORT_C TUint ParseMask() const; + IMPORT_C TUint UnitsMask() const; + + // For change notifier + IMPORT_C TUint Changes() const; + +private: + CMemSpyApiKernelObjectItem(); + + void ConstructL(const TMemSpyDriverHandleInfoGeneric& aData); + +private: + TMemSpyDriverHandleInfoGeneric *iItem; +}; + + +#endif // MEMSPYAPIKERNELOBJECTITEM_H diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/MemSpyClient/inc/memspyapiprocess.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/memspy/MemSpyClient/inc/memspyapiprocess.h Fri May 14 17:25:03 2010 +0300 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Contains the declaration of CMemSpyProcess class +*/ + +#ifndef MEMSPYAPIPROCESS_H +#define MEMSPYAPIPROCESS_H + +// System includes +#include + +class TMemSpyProcessData; + +NONSHARABLE_CLASS( CMemSpyApiProcess ) + { +public: + IMPORT_C ~CMemSpyApiProcess(); + + static CMemSpyApiProcess* NewL(const TMemSpyProcessData& aData); + + static CMemSpyApiProcess* NewLC(const TMemSpyProcessData& aData); + +public: + IMPORT_C TProcessId Id() const; + + IMPORT_C const TDesC& Name() const; + + IMPORT_C TExitCategoryName ExitCategory() const; + + IMPORT_C TInt ExitReason() const; + + IMPORT_C TExitType ExitType() const; + + IMPORT_C TInt ThreadCount() const; + +private: + CMemSpyApiProcess(); + + void ConstructL(const TMemSpyProcessData& aData); + +private: + TMemSpyProcessData *iProcessData; +}; + + +#endif // MEMSPYAPIPROCESS_H diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/MemSpyClient/inc/memspyapithread.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/memspy/MemSpyClient/inc/memspyapithread.h Fri May 14 17:25:03 2010 +0300 @@ -0,0 +1,73 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Contains the declaration of CMemSpyProcessWrapper class and TMemSpyProcess data class +*/ + +#ifndef MEMSPYAPITHREAD_H +#define MEMSPYAPITHREAD_H + +// System includes +#include + +class TMemSpyThreadData; + +NONSHARABLE_CLASS( CMemSpyApiThread ) { + +public: + IMPORT_C ~CMemSpyApiThread(); + + static CMemSpyApiThread* NewL(const TMemSpyThreadData& aData); + + static CMemSpyApiThread* NewLC(const TMemSpyThreadData& aData); + +public: + IMPORT_C TThreadId Id() const; + IMPORT_C TProcessId ProcessId() const; + + IMPORT_C const TDesC& Name() const; + + IMPORT_C TInt SID() const; + + IMPORT_C TInt VID() const; + + IMPORT_C TThreadPriority ThreadPriority() const; + + IMPORT_C TProcessPriority ProcessPriority() const; + + IMPORT_C TInt RequestCount() const; + + IMPORT_C TInt ThreadHandles() const; + + IMPORT_C TInt ProcessHandles() const; + + IMPORT_C TInt ThreadNumberUsing() const; + + IMPORT_C TInt ProcessNumberUsing() const; + + IMPORT_C TInt Attributes() const; + + IMPORT_C TInt CpuUse() const; + + IMPORT_C TExitType ExitType() const; + +private: + CMemSpyApiThread(); + + void ConstructL(const TMemSpyThreadData& aData); +private: + TMemSpyThreadData* iThreadData; +}; + +#endif diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/MemSpyClient/inc/memspyheapdata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/memspy/MemSpyClient/inc/memspyheapdata.h Fri May 14 17:25:03 2010 +0300 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Contains the declaration of TMemSpyProcessData class +*/ + +#ifndef MEMSPYHEAPDATA_H +#define MEMSPYHEAPDATA_H + +#include + +// Constants +const TInt KBuf = 16; + +// TMemSpyProcess data class holds data to be sent to the UI +class TMemSpyHeapData + { +public: + //constructor & destructor + inline TMemSpyHeapData() + : iSize(0), iBaseAddress(0), iShared(EFalse), iChunkSize(0), + iAllocationsCount(0), iFreeCount(0), iBiggestAllocation(0), iBiggestFree(0), iTotalAllocations(0), + iTotalFree(0), iSlackFreeSpace(0), iFragmentation(0), iHeaderSizeA(0), iHeaderSizeF(0), iAllocationOverhead(0), + iFreeOverhead(0), iTotalOverhead(0), iOverhead(0), iMinLength(0), iMaxLength(0), iDebugAllocatorLibrary(EFalse) + { + } + +public: + TBuf iType; + TUint iSize; + TUint8 iBaseAddress; + TBool iShared; + TUint iChunkSize; + TUint iAllocationsCount; + TUint iFreeCount; + TUint iBiggestAllocation; + TUint iBiggestFree; + TUint iTotalAllocations; + TUint iTotalFree; + TUint iSlackFreeSpace; + TReal iFragmentation; + TUint iHeaderSizeA; + TUint iHeaderSizeF; + TUint iAllocationOverhead; + TUint iFreeOverhead; + TUint iTotalOverhead; + TReal iOverhead; + TInt iMinLength; + TInt iMaxLength; + TBool iDebugAllocatorLibrary; + }; + +#endif // MEMSPYHEAPDATA_H diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/MemSpyClient/inc/memspykernelobjectdata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/memspy/MemSpyClient/inc/memspykernelobjectdata.h Fri May 14 17:25:03 2010 +0300 @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Contains the declaration of TMemSpyProcessData class +*/ + +#ifndef MEMSPYKERNELOBJECTDATA_H +#define MEMSPYKERNELOBJECTDATA_H + +#include + +// Constants +const TInt KBufSize = 128; + +// TMemSpyProcess data class holds data to be sent to the UI +class TMemSpyKernelObjectData + { +public: + //constructor & destructor + inline TMemSpyKernelObjectData() + : iCount(0), iSize(0) + { + } + +public: + TMemSpyDriverContainerType iType; + TBuf iName; + TInt iCount; + TInt64 iSize; + }; + +#endif // MEMSPYKERNELOBJECTDATA_H diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/MemSpyClient/inc/memspyprocessdata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/memspy/MemSpyClient/inc/memspyprocessdata.h Fri May 14 17:25:03 2010 +0300 @@ -0,0 +1,44 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Contains the declaration of TMemSpyProcessData class +*/ + +#ifndef MEMSPYPROCESSDATA_H +#define MEMSPYPROCESSDATA_H + +#include + +// TMemSpyProcess data class holds data to be sent to the UI +class TMemSpyProcessData + { +public: + //constructor & destructor + inline TMemSpyProcessData() + : iId(0), iThreadCount(0), iExitCategory(0), iExitReason(0) + { + } + +public: + TProcessId iId; + TFullName iName; + TProcessPriority iPriority; + TExitCategoryName iExitCategory; + TInt iExitReason; + TExitType iExitType; + TInt iThreadCount; + TMemSpyDriverProcessInfo iInfo; + }; + +#endif // MEMSPYPROCESSDATA_H diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/MemSpyClient/inc/memspysession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/memspy/MemSpyClient/inc/memspysession.h Fri May 14 17:25:03 2010 +0300 @@ -0,0 +1,164 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef MEMSPYSESSION_H +#define MEMSPYSESSION_H + + +// System includes +#include +#include + +//user includes +#include //for Processes +#include +#include //for Threads +#include +#include //for KernelObjects +#include +#include //for KernelObjectItems +#include //for Heap +#include + +// Constants +const TInt KMemSpyVersion = 2; + +// Literal constants +_LIT( KMemSpyServer2, "MemSpyServer.exe" ); + + +// +enum TMemSpyOperations + { + //Output operations + +// EGetSinkType, +// EOutputToDebug, +// EOutputToFile, +// EOutputKernelObjects, +// ESetServerTimeOutStatus, +// EOutputProcessInfo, + + //Processes operations + + EGetProcessCount, + EGetProcesses, + EGetThreadCount, + EGetThreads, + ESetThreadPriority, + EProcessSystemPermanentOrCritical, + EEndProcess, + ESwitchToProcess, +// EOpenCloseCurrentProcess + + //Threads operations + EThreadSystemPermanentOrCritical, + EEndThread, + ESwitchToThread, + + //Kernel Objects operations + EGetKernelObjectTypeCount, + EGetKernelObjects, + EGetKernelObjectItemsCount, + EGetKernelObjectItems, + //EOutputKernelObjects + + //Heap operations + EGetHeap + }; + +enum TSortType + { + ESortProcById, + ESortProcByName, + ESortProcByThreadCount, + ESortProcByCodeSegs, + ESortProcByHeapUsage, + ESortProcByStackUsage + }; + +enum TEndType + { + ETerminate, + EKill, + EPanic +}; + +NONSHARABLE_CLASS( RMemSpySession ) : public RSessionBase + { +public: + IMPORT_C RMemSpySession(); + IMPORT_C TInt Connect(); + +public: //API + //Output operations + //inline TMemSpySinkType GetSinkType(); + //inline void OutputToDebug(); + //inline void OutputToFile(); + //inline void OutputKernelObjects(); + //inline void SetServerTimeOutStatus( TUint32 aValue, TBool aEnabled ); + //inline void OutputProcessInfo( TMemSpyProcess aProcess ); + + //Processes operations + /** + * + */ + IMPORT_C void GetProcessesL(RArray &aProcesses, TSortType aSortType = ESortProcById); + + IMPORT_C void GetThreadsL(TProcessId aProcessId, RArray &aThreads, TSortType aSortType = ESortProcById); + IMPORT_C TInt ProcessSystemPermanentOrCritical( TProcessId aId, TBool aValue ); //aValue -> return value + + IMPORT_C void SetThreadPriorityL(TThreadId aId, TInt aPriority); + IMPORT_C TInt EndProcess( TProcessId aId, TEndType aType ); + + IMPORT_C TInt SwitchToProcess( TProcessId aId, TBool aBrought ); + + //inline void OpenCloseCurrentProcess( TProcessId aId, TBool aOpen ); + + //Threads operations + /** + * + */ + IMPORT_C void GetThreadsL(TProcessId aProcessId, RArray &aThreads, TSortType aSortType = ESortProcById); + + IMPORT_C TInt ThreadSystemPermanentOrCritical( TThreadId aId, TBool aValue ); + + IMPORT_C TInt EndThread( TThreadId aId, TEndType aType ); + + IMPORT_C TInt SwitchToThread( TThreadId aId, TBool aBrought ); + + //KernelObjects operations + /** + * + */ + IMPORT_C TInt GetKernelObjects( RArray &aKernelObjects ); + + IMPORT_C TInt GetKernelObjectItems( RArray &aKernelObjectItems, TMemSpyDriverContainerType aForContainer ); + + /** + * + */ + //IMPORT_C TInt GetHeap( RArray &aHeap ); + //IMPORT_C TInt GetHeap( CMemSpyApiHeap* aHeap ); + IMPORT_C CMemSpyApiHeap* GetHeap(); + +private: + TInt StartServer(); + }; + +#endif // MEMSPYSESSION_H diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/MemSpyClient/inc/memspythreaddata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/memspy/MemSpyClient/inc/memspythreaddata.h Fri May 14 17:25:03 2010 +0300 @@ -0,0 +1,50 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#ifndef MEMSPYTHREADDATA_H +#define MEMSPYTHREADDATA_H + +//#include + +class TMemSpyThreadData { +public: + TMemSpyThreadData() + : iId(0), iPid(0), iSID(0), iVID(0), iRequestCount(0), iThreadHandles(0), iProcessHandles(0), iThreadNumberUsing(0), + iProcessNumberUsing(0), iAttributes(0), iCpuUse(0) + { + } + +public: + TThreadId iId; + TProcessId iPid; + TFullName iName; //name without formatting. Formatting to be moved to the Avkon UI part + TInt iSID; + TInt iVID; + TThreadPriority iThreadPriority; + TProcessPriority iProcessPriority; + TInt iRequestCount; + TInt iThreadHandles; + TInt iProcessHandles; + TInt iThreadNumberUsing; + TInt iProcessNumberUsing; + TInt iAttributes; + TInt iCpuUse; + TExitType iExitType; + RArray iRegisters; //containts register contents of the thread (R00-R12, SP, LR, PC, Flags & DACR) - TUint for formating to HEX +}; + +#endif diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/MemSpyClient/src/memspyapiheap.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/memspy/MemSpyClient/src/memspyapiheap.cpp Fri May 14 17:25:03 2010 +0300 @@ -0,0 +1,162 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include +#include + + +CMemSpyApiHeap::CMemSpyApiHeap() + : iHeapData(0) + { + } + +EXPORT_C CMemSpyApiHeap::~CMemSpyApiHeap() + { + delete iHeapData; + } + +void CMemSpyApiHeap::ConstructL(const TMemSpyHeapData& aData) + { + iHeapData = new (ELeave) TMemSpyHeapData(aData); + } + +CMemSpyApiHeap* CMemSpyApiHeap::NewL(const TMemSpyHeapData& aData) + { + CMemSpyApiHeap* self = CMemSpyApiHeap::NewLC(aData); + CleanupStack::Pop(self); + return (self); + } + +CMemSpyApiHeap* CMemSpyApiHeap::NewLC(const TMemSpyHeapData& aData) + { + CMemSpyApiHeap* self = new (ELeave) CMemSpyApiHeap; + CleanupStack::PushL(self); + self->ConstructL(aData); + return (self); + } + +//api methods +EXPORT_C TDesC& CMemSpyApiHeap::Type() + { + return iHeapData->iType; + } + +EXPORT_C TInt CMemSpyApiHeap::Size() + { + return iHeapData->iSize; + } + +EXPORT_C TInt CMemSpyApiHeap::BaseAddress() + { + return iHeapData->iBaseAddress; + } + +EXPORT_C TBool CMemSpyApiHeap::Shared() + { + return iHeapData->iShared; + } + +EXPORT_C TInt CMemSpyApiHeap::ChunkSize() + { + return iHeapData->iChunkSize; + } + +EXPORT_C TInt CMemSpyApiHeap::AllocationsCount() + { + return iHeapData->iAllocationsCount; + } + +EXPORT_C TInt CMemSpyApiHeap::FreeCount() + { + return iHeapData->iFreeCount; + } + +EXPORT_C TInt CMemSpyApiHeap::BiggestAllocation() + { + return iHeapData->iBiggestAllocation; + } + +EXPORT_C TInt CMemSpyApiHeap::BiggestFree() + { + return iHeapData->iBiggestFree; + } + +EXPORT_C TInt CMemSpyApiHeap::TotalAllocations() + { + return iHeapData->iTotalAllocations; + } + +EXPORT_C TInt CMemSpyApiHeap::TotalFree() + { + return iHeapData->iTotalFree; + } + +EXPORT_C TInt CMemSpyApiHeap::SlackFreeSpace() + { + return iHeapData->iSlackFreeSpace; + } + +EXPORT_C TInt CMemSpyApiHeap::Fragmentation() + { + return iHeapData->iFragmentation; + } + +EXPORT_C TInt CMemSpyApiHeap::HeaderSizeA() + { + return iHeapData->iHeaderSizeA; + } + +EXPORT_C TInt CMemSpyApiHeap::HeaderSizeF() + { + return iHeapData->iHeaderSizeF; + } + +EXPORT_C TInt CMemSpyApiHeap::AllocationOverhead() + { + return iHeapData->iAllocationOverhead; + } + +EXPORT_C TInt CMemSpyApiHeap::FreeOverhead() + { + return iHeapData->iFreeOverhead; + } + +EXPORT_C TInt CMemSpyApiHeap::TotalOverhead() + { + return iHeapData->iTotalOverhead; + } + +EXPORT_C TInt CMemSpyApiHeap::Overhead() + { + return iHeapData->iOverhead; + } + +EXPORT_C TInt CMemSpyApiHeap::MinLength() + { + return iHeapData->iMinLength; + } + +EXPORT_C TInt CMemSpyApiHeap::MaxLength() + { + return iHeapData->iMaxLength; + } + +EXPORT_C TBool CMemSpyApiHeap::DebugAllocatorLibrary() + { + return iHeapData->iDebugAllocatorLibrary; + } diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/MemSpyClient/src/memspyapikernelobject.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/memspy/MemSpyClient/src/memspyapikernelobject.cpp Fri May 14 17:25:03 2010 +0300 @@ -0,0 +1,72 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include +//#include +//#include + + +EXPORT_C CMemSpyApiKernelObject::~CMemSpyApiKernelObject() + { + delete iKernelObjectData; + } + + +CMemSpyApiKernelObject::CMemSpyApiKernelObject() : iKernelObjectData(0) + { + } + +CMemSpyApiKernelObject* CMemSpyApiKernelObject::NewL(const TMemSpyKernelObjectData& aData) + { + CMemSpyApiKernelObject* self = CMemSpyApiKernelObject::NewLC(aData); + CleanupStack::Pop(self); + return (self); + } + +CMemSpyApiKernelObject* CMemSpyApiKernelObject::NewLC(const TMemSpyKernelObjectData& aData) + { + CMemSpyApiKernelObject* self = new (ELeave) CMemSpyApiKernelObject; + CleanupStack::PushL(self); + self->ConstructL(aData); + return (self); + } + +void CMemSpyApiKernelObject::ConstructL(const TMemSpyKernelObjectData& aData) + { + iKernelObjectData = new (ELeave) TMemSpyKernelObjectData(aData); + } + +EXPORT_C TMemSpyDriverContainerType CMemSpyApiKernelObject::Type() const + { + return iKernelObjectData->iType; + } + +EXPORT_C const TDesC& CMemSpyApiKernelObject::Name() const + { + return iKernelObjectData->iName; + } + +EXPORT_C TInt CMemSpyApiKernelObject::Count() const + { + return iKernelObjectData->iCount; + } + +EXPORT_C TInt64 CMemSpyApiKernelObject::Size() const + { + return iKernelObjectData->iSize; + } diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/MemSpyClient/src/memspyapikernelobjectitem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/memspy/MemSpyClient/src/memspyapikernelobjectitem.cpp Fri May 14 17:25:03 2010 +0300 @@ -0,0 +1,309 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include + +EXPORT_C CMemSpyApiKernelObjectItem::~CMemSpyApiKernelObjectItem() + { + delete iItem; + } + + +CMemSpyApiKernelObjectItem::CMemSpyApiKernelObjectItem() : iItem(0) + { + } + +CMemSpyApiKernelObjectItem* CMemSpyApiKernelObjectItem::NewL(const TMemSpyDriverHandleInfoGeneric& aData) + { + CMemSpyApiKernelObjectItem* self = CMemSpyApiKernelObjectItem::NewLC(aData); + CleanupStack::Pop(self); + return (self); + } + +CMemSpyApiKernelObjectItem* CMemSpyApiKernelObjectItem::NewLC(const TMemSpyDriverHandleInfoGeneric& aData) + { + CMemSpyApiKernelObjectItem* self = new (ELeave) CMemSpyApiKernelObjectItem; + CleanupStack::PushL(self); + self->ConstructL(aData); + return (self); + } + +void CMemSpyApiKernelObjectItem::ConstructL(const TMemSpyDriverHandleInfoGeneric& aData) + { + iItem = new (ELeave) TMemSpyDriverHandleInfoGeneric(aData); + } + +EXPORT_C const TDesC8& CMemSpyApiKernelObjectItem::Name() const + { + /* + TBuf ret; + ret.Copy( iItem->iName ); + return ret; + */ + return iItem->iName; + } + +EXPORT_C TAny* CMemSpyApiKernelObjectItem::Handle() const + { + return iItem->iHandle; + } + +EXPORT_C TMemSpyDriverContainerType CMemSpyApiKernelObjectItem::Type() const + { + return iItem->iType; + } + +// For Process, thread, chunk (owning process id), server (owning thread id) +EXPORT_C TInt CMemSpyApiKernelObjectItem::Id() const + { + return iItem->iId; + } + +// For Chunk, Library +EXPORT_C TUint32 CMemSpyApiKernelObjectItem::Size() const + { + return iItem->iSize; + } + +// For Semaphore, Mutex, Server +EXPORT_C TInt CMemSpyApiKernelObjectItem::Count() const + { + return iItem->iCount; + } + +// For Mutex +EXPORT_C TInt CMemSpyApiKernelObjectItem::WaitCount() const + { + return iItem->iWaitCount; + } + +// For Server, Session +EXPORT_C TIpcSessionType CMemSpyApiKernelObjectItem::SessionType() const + { + return iItem->iSessionType; + } + +// For Timer +EXPORT_C TMemSpyDriverTimerType CMemSpyApiKernelObjectItem::TimerType() const + { + return iItem->iTimerType; + } + +EXPORT_C TMemSpyDriverTimerState CMemSpyApiKernelObjectItem::TimerState() const + { + return iItem->iTimerState; + } + +// For Logical channel +EXPORT_C TInt CMemSpyApiKernelObjectItem::OpenChannels() + { + return iItem->iOpenChannels; + } + +// For most of the object types +EXPORT_C const TDesC8& CMemSpyApiKernelObjectItem::NameDetail() const + { + /* + TBuf ret; + ret.Copy( iItem->iNameDetail ); + return ret; + */ + return iItem->iNameDetail; + } + +EXPORT_C TInt CMemSpyApiKernelObjectItem::AccessCount() const + { + return iItem->iAccessCount; + } + +EXPORT_C TInt CMemSpyApiKernelObjectItem::UniqueID() const + { + return iItem->iUniqueID; + } + +EXPORT_C TUint CMemSpyApiKernelObjectItem::Protection() const + { + return iItem->iProtection; + } + +EXPORT_C TUint8* CMemSpyApiKernelObjectItem::AddressOfKernelOwner() + { + return iItem->iAddressOfKernelOwner; + } + +EXPORT_C TInt CMemSpyApiKernelObjectItem::Priority() const + { + return iItem->iPriority; + } + +EXPORT_C TUint8* CMemSpyApiKernelObjectItem::AddressOfOwningProcess() + { + return iItem->iAddressOfOwningProcess; + } + +EXPORT_C TUint CMemSpyApiKernelObjectItem::CreatorId() const + { + return iItem->iCreatorId; + } + +EXPORT_C TUint CMemSpyApiKernelObjectItem::SecurityZone() const + { + return iItem->iSecurityZone; + } + +EXPORT_C TInt CMemSpyApiKernelObjectItem::Attributes() const + { + return iItem->iAttributes; + } + +EXPORT_C TUint8* CMemSpyApiKernelObjectItem::AddressOfDataBssStackChunk() + { + return iItem->iAddressOfDataBssStackChunk; + } + +// For Server, Session +EXPORT_C TUint8* CMemSpyApiKernelObjectItem::AddressOfOwningThread() + { + return iItem->iAddressOfOwningThread; + } + +EXPORT_C TUint8* CMemSpyApiKernelObjectItem::AddressOfServer() + { + return iItem->iAddressOfServer; + } + +EXPORT_C TUint16 CMemSpyApiKernelObjectItem::TotalAccessCount() const + { + return iItem->iTotalAccessCount; + } + +EXPORT_C TUint8 CMemSpyApiKernelObjectItem::SvrSessionType() const + { + return iItem->iSvrSessionType; + } + +EXPORT_C TInt CMemSpyApiKernelObjectItem::MsgCount() const + { + return iItem->iMsgCount; + } + +EXPORT_C TInt CMemSpyApiKernelObjectItem::MsgLimit() const + { + return iItem->iMsgLimit; + } + +// For chunk +EXPORT_C TInt CMemSpyApiKernelObjectItem::MaxSize() const + { + return iItem->iMaxSize; + } + +EXPORT_C TInt CMemSpyApiKernelObjectItem::Bottom() const + { + return iItem->iBottom; + } + +EXPORT_C TInt CMemSpyApiKernelObjectItem::Top() const + { + return iItem->iTop; + } + +EXPORT_C TInt CMemSpyApiKernelObjectItem::StartPos() const + { + return iItem->iStartPos; + } + +EXPORT_C TUint CMemSpyApiKernelObjectItem::ControllingOwner() const + { + return iItem->iControllingOwner; + } + +EXPORT_C TUint CMemSpyApiKernelObjectItem::Restrictions() const + { + return iItem->iRestrictions; + } + +EXPORT_C TUint CMemSpyApiKernelObjectItem::MapAttr() const + { + return iItem->iMapAttr; + } + +EXPORT_C TUint CMemSpyApiKernelObjectItem::ChunkType() const + { + return iItem->iChunkType; + } + +EXPORT_C const TDesC8& CMemSpyApiKernelObjectItem::NameOfOwner() const + { + /* + TBuf ret; + ret.Copy( iItem->iNameOfOwner ); + return ret; + */ + return iItem->iNameOfOwner; + } + +// For library +EXPORT_C TInt CMemSpyApiKernelObjectItem::MapCount() const + { + return iItem->iMapCount; + } + +EXPORT_C TUint8 CMemSpyApiKernelObjectItem::State() const + { + return iItem->iState; + } + +EXPORT_C TUint8* CMemSpyApiKernelObjectItem::AddressOfCodeSeg() + { + return iItem->iAddressOfCodeSeg; + } + +// Semaphore, mutex, condvar +EXPORT_C TUint8 CMemSpyApiKernelObjectItem::Resetting() const + { + return iItem->iResetting; + } + +EXPORT_C TUint8 CMemSpyApiKernelObjectItem::Order() const + { + return iItem->iOrder; + } + +// For Logical/Physical device +EXPORT_C TVersion CMemSpyApiKernelObjectItem::Version() const + { + return iItem->iVersion; + } + +EXPORT_C TUint CMemSpyApiKernelObjectItem::ParseMask() const + { + return iItem->iParseMask; + } + +EXPORT_C TUint CMemSpyApiKernelObjectItem::UnitsMask() const + { + return iItem->iUnitsMask; + } + +// For change notifier +EXPORT_C TUint CMemSpyApiKernelObjectItem::Changes() const + { + return iItem->iChanges; + } + diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/MemSpyClient/src/memspyapiprocess.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/memspy/MemSpyClient/src/memspyapiprocess.cpp Fri May 14 17:25:03 2010 +0300 @@ -0,0 +1,84 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include +#include +#include +#include + + +EXPORT_C CMemSpyApiProcess::~CMemSpyApiProcess() + { + delete iProcessData; + } + +EXPORT_C TProcessId CMemSpyApiProcess::Id() const + { + return iProcessData->iId; + } + +EXPORT_C const TDesC& CMemSpyApiProcess::Name() const + { + return iProcessData->iName; + } + +EXPORT_C TExitCategoryName CMemSpyApiProcess::ExitCategory() const + { + return iProcessData->iExitCategory; + } + +EXPORT_C TInt CMemSpyApiProcess::ExitReason() const + { + return iProcessData->iExitReason; + } + +EXPORT_C TExitType CMemSpyApiProcess::ExitType() const + { + return iProcessData->iExitType; + } + +EXPORT_C TInt CMemSpyApiProcess::ThreadCount() const + { + return iProcessData->iThreadCount; + } + + +CMemSpyApiProcess::CMemSpyApiProcess() : iProcessData(0) + { + } + +void CMemSpyApiProcess::ConstructL(const TMemSpyProcessData& aData) + { + iProcessData = new (ELeave) TMemSpyProcessData(aData); + } + +CMemSpyApiProcess* CMemSpyApiProcess::NewL(const TMemSpyProcessData& aData) + { + CMemSpyApiProcess* self = CMemSpyApiProcess::NewLC(aData); + CleanupStack::Pop(self); + return (self); + } + +CMemSpyApiProcess* CMemSpyApiProcess::NewLC(const TMemSpyProcessData& aData) + { + CMemSpyApiProcess* self = new (ELeave) CMemSpyApiProcess; + CleanupStack::PushL(self); + self->ConstructL(aData); + return (self); + } + diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/MemSpyClient/src/memspyapithread.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/memspy/MemSpyClient/src/memspyapithread.cpp Fri May 14 17:25:03 2010 +0300 @@ -0,0 +1,125 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include + + +EXPORT_C CMemSpyApiThread::~CMemSpyApiThread() + { + delete iThreadData; + } + +EXPORT_C TThreadId CMemSpyApiThread::Id() const + { + return iThreadData->iId; + } + +EXPORT_C TProcessId CMemSpyApiThread::ProcessId() const + { + return iThreadData->iPid; + } + +EXPORT_C const TDesC& CMemSpyApiThread::Name() const + { + return iThreadData->iName; + } + +EXPORT_C TInt CMemSpyApiThread::SID() const + { + return iThreadData->iSID; + } + + +EXPORT_C TInt CMemSpyApiThread::VID() const + { + return iThreadData->iVID; + } + +EXPORT_C TThreadPriority CMemSpyApiThread::ThreadPriority() const + { + return iThreadData->iThreadPriority; + } + +EXPORT_C TProcessPriority CMemSpyApiThread::ProcessPriority() const + { + return iThreadData->iProcessPriority; + } + +EXPORT_C TInt CMemSpyApiThread::RequestCount() const + { + return iThreadData->iRequestCount; + } + +EXPORT_C TInt CMemSpyApiThread::ThreadHandles() const + { + return iThreadData->iThreadHandles; + } + +EXPORT_C TInt CMemSpyApiThread::ProcessHandles() const + { + return iThreadData->iProcessHandles; + } + +EXPORT_C TInt CMemSpyApiThread::ThreadNumberUsing() const + { + return iThreadData->iThreadNumberUsing; + } + +EXPORT_C TInt CMemSpyApiThread::ProcessNumberUsing() const + { + return iThreadData->iProcessNumberUsing; + } + +EXPORT_C TInt CMemSpyApiThread::Attributes() const + { + return iThreadData->iAttributes; + } + +EXPORT_C TInt CMemSpyApiThread::CpuUse() const + { + return iThreadData->iCpuUse; + } + +EXPORT_C TExitType CMemSpyApiThread::ExitType() const + { + return iThreadData->iExitType; + } + +CMemSpyApiThread::CMemSpyApiThread() : iThreadData(0) + { + } + +void CMemSpyApiThread::ConstructL(const TMemSpyThreadData& aData) + { + iThreadData = new (ELeave) TMemSpyThreadData(aData); + } + +CMemSpyApiThread* CMemSpyApiThread::NewL(const TMemSpyThreadData& aData) + { + CMemSpyApiThread* self = CMemSpyApiThread::NewLC(aData); + CleanupStack::Pop(self); + return (self); + } + +CMemSpyApiThread* CMemSpyApiThread::NewLC(const TMemSpyThreadData& aData) + { + CMemSpyApiThread* self = new (ELeave) CMemSpyApiThread; + CleanupStack::PushL(self); + self->ConstructL(aData); + return (self); + } diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/MemSpyClient/src/memspysession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/memspy/MemSpyClient/src/memspysession.cpp Fri May 14 17:25:03 2010 +0300 @@ -0,0 +1,394 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#include "memspysession.h" +#include +#include +#include +//KernelObjects +#include +// IMPLEMENTATION + +EXPORT_C RMemSpySession::RMemSpySession() + { + } + + +EXPORT_C TInt RMemSpySession::Connect() + { + TInt error(KErrNone); + + for (TInt i=0; i<2; i++) // Two retries max + { + TInt error = CreateSession(KMemSpyServer2, TVersion(KMemSpyVersion, 0, 0)); + + if (error != KErrNotFound && error != KErrServerTerminated) + return error; + + error = StartServer(); + + if (error != KErrNone && error != KErrAlreadyExists) + return error; + } + + return error; + } + +TInt RMemSpySession::StartServer() + { + RProcess server; + _LIT(KCommand, "start"); + const TUid KServerUid3 = {0xE5883BC2}; + TInt error = server.Create(KMemSpyServer2, KCommand);//, KServerUid3); + + if (error != KErrNone) + return error; + + TRequestStatus startStatus, stopStatus; + server.Logon(stopStatus); + if (stopStatus != KRequestPending) + { + User::WaitForRequest(stopStatus); + server.Kill(0); + server.Close(); + return stopStatus.Int(); + } + + server.Rendezvous(startStatus); + server.Resume(); + User::WaitForRequest(startStatus, stopStatus); + if (startStatus == KRequestPending) + { + // not started yet, i.e. stopStatus was signaled + server.Close(); + return stopStatus.Int(); + } + + // Rendezvous was called - the server is ready + + // We first need to cancel Logon + server.LogonCancel(stopStatus); + // We don't need this anymore + server.Close(); + // Wait for LogonCancel to complete + User::WaitForRequest(stopStatus); + + // Everything went OK + return KErrNone; + } + +//inline void RMemSpySession::Close() +// { +// RSessionBase::Close(); +// } +// +//inline TMemSpySinkType RMemSpySession::GetSinkType() +// { +// TPckgBuf OutBuf; +// TIpcArgs args( &OutBuf ); +// SendReceive( EGetSinkType, args ); +// return OutBuf(); +// } +// +//inline void RMemSpySession::OutputKernelObjects() +// { +// SendReceive( EOutputKernelObjects ); +// } +// +//inline void RMemSpySession::OutputToDebug() +// { +// SendReceive( EOutputToDebug ); +// } +// +//inline void RMemSpySession::OutputToFile() +// { +// SendReceive( EOutputToFile ); +// } +// +//inline void RMemSpySession::SetServerTimeOutStatus( TUint32 aValue, TBool aEnabled ) +// { +// TPckgBuf In1(aValue); +// TPckgBuf In2(aEnabled); +// TIpcArgs args( &In1, &In2 ); +// SendReceive( ESetServerTimeOutStatus, args ); +// } + +//inline void RMemSpySession::OutputProcessInfo( TMemSpyProcess aProcess ) +// { +// TProcessId iId = aProcess.iId; +// TPckgBuf In( iId ); +// TIpcArgs args( &In ); +// SendReceive( EOutputProcessInfo, args ); +// } + +////Processes operations +//inline TInt RMemSpySession::ProcessesCount() +// { +// TPckgBuf Out; +// TIpcArgs args( &Out ); +// SendReceive( EProcessesCount, args ); +// return Out(); +// } +// +//inline TMemSpyProcess RMemSpySession::GetProcessByIndex( TInt aIndex ) +// { +// TPckgBuf In( aIndex ); +// TPckgBuf Out; +// TIpcArgs args( &In, &Out ); +// SendReceive( EProcessByIndex, args ); +// return Out(); +// } +// +//inline TInt RMemSpySession::ProcessIndexById( TProcessId aId ) +// { +// TPckgBuf In( aId ); +// TPckgBuf Out; +// TIpcArgs args( &In, &Out ); +// SendReceive( EProcessIndexById, args ); +// return Out(); +// } +// +//inline TBool RMemSpySession::ProcessIsDead( TMemSpyProcess aProcess ) +// { +// TProcessId iId = aProcess.iId; +// TPckgBuf In( iId ); +// TPckgBuf Out; +// TIpcArgs args( &In, &Out ); +// SendReceive( EProcessIsDead, args ); +// return Out(); +// } + +EXPORT_C void RMemSpySession::GetProcessesL(RArray &aProcesses, TSortType aSortType) + { + TPckgBuf count; + User::LeaveIfError(SendReceive(EGetProcessCount, TIpcArgs(&count))); + + TInt requestedCount = count(); + HBufC8* buffer = HBufC8::NewLC(requestedCount * sizeof(TMemSpyProcessData)); + TPtr8 bufferPtr(buffer->Des()); + + User::LeaveIfError(SendReceive(EGetProcesses, TIpcArgs(&count, &bufferPtr))); + aProcesses.Reset(); + + TInt receivedCount = Min(count(), requestedCount); + for(TInt i=0, offset = 0; i data; + data.Copy(bufferPtr.Ptr()+offset, sizeof(TMemSpyProcessData)); + aProcesses.AppendL(CMemSpyApiProcess::NewLC(data())); + } + CleanupStack::Pop(aProcesses.Count()); + CleanupStack::PopAndDestroy(buffer); + } + +EXPORT_C TInt RMemSpySession::ProcessSystemPermanentOrCritical( TProcessId aId, TBool aValue ) + { + TPckgBuf arg1( aId ); + TPckgBuf arg2( aValue ); + TIpcArgs args( &arg1, &arg2 ); + + TInt error = SendReceive( EProcessSystemPermanentOrCritical, args ); + + return error; + } + +EXPORT_C TInt RMemSpySession::EndProcess( TProcessId aId, TEndType aType ) + { + TPckgBuf arg1( aId ); + TPckgBuf arg2( aType ); + TIpcArgs args( &arg1, &arg2 ); + + TInt error = SendReceive( EEndProcess, args ); + + return error; + } + +EXPORT_C TInt RMemSpySession::SwitchToProcess( TProcessId aId, TBool aBrought ) + { + TPckgBuf arg1( aId ); + TPckgBuf arg2( aBrought ); + TIpcArgs args( &arg1, &arg2 ); + + TInt error = SendReceive( ESwitchToProcess, args ); + + return error; + } + +EXPORT_C void RMemSpySession::GetThreadsL(TProcessId aProcessId, RArray &aThreads, TSortType aSortType) + { + TPckgBuf count; + TPckgBuf pid(aProcessId); + User::LeaveIfError(SendReceive(EGetThreadCount, TIpcArgs(&count, &pid))); + + TInt requestedCount = count(); + HBufC8* buffer = HBufC8::NewLC(requestedCount * sizeof(TMemSpyThreadData)); + TPtr8 bufferPtr(buffer->Des()); + + User::LeaveIfError(SendReceive(EGetThreads, TIpcArgs(&count, &bufferPtr, &pid))); + aThreads.Reset(); + + TInt receivedCount = Min(count(), requestedCount); + for(TInt i=0, offset = 0; i data; + data.Copy(bufferPtr.Ptr()+offset, sizeof(TMemSpyThreadData)); + aThreads.AppendL(CMemSpyApiThread::NewLC(data())); + } + CleanupStack::Pop(aThreads.Count()); + CleanupStack::PopAndDestroy(buffer); + } + +EXPORT_C void RMemSpySession::SetThreadPriorityL(TThreadId aId, TInt aPriority) + { + TPckgBuf arg1( aId ); + TPckgBuf arg2( aPriority ); + + User::LeaveIfError(SendReceive( ESetThreadPriority, TIpcArgs(&arg1, &arg2))); + } + +EXPORT_C TInt RMemSpySession::ThreadSystemPermanentOrCritical( TThreadId aId, TBool aValue ) + { + TPckgBuf arg1( aId ); + TPckgBuf arg2( aValue ); + TIpcArgs args( &arg1, &arg2 ); + + TInt error = SendReceive( EThreadSystemPermanentOrCritical, args ); + + return error; + } + +EXPORT_C TInt RMemSpySession::EndThread( TThreadId aId, TEndType aType ) + { + TPckgBuf arg1( aId ); + TPckgBuf arg2( aType ); + TIpcArgs args( &arg1, &arg2 ); + + TInt error = SendReceive( EEndThread, args ); + + return error; + } + +EXPORT_C TInt RMemSpySession::SwitchToThread( TThreadId aId, TBool aBrought ) + { + + } +/* +EXPORT_C TInt RMemSpySession::TerminateThread( TThreadId aId ) + { + TPckgBuf arg( aId ); + TIpcArgs args( &arg ); + + TInt error = SendReceive( ETerminateThread, args ); + + return error; + } +*/ + +//inline void RMemSpySession::SortProcessesBy( TSortType aType ) +// { +// TPckgBuf In( aType ); +// TIpcArgs args( &In ); +// SendReceive( ESortProcessesBy, args ); +// } + +//inline void RMemSpySession::OpenCloseCurrentProcess( TProcessId aId, TBool aOpen ) +// { +// TPckgBuf In1( aId ); +// TPckgBuf In2( aOpen ); +// TIpcArgs args( &In1, &In2 ); +// SendReceive( EOpenCloseCurrentProcess, args ); +// } + +//Kernel Objects specific operations +EXPORT_C TInt RMemSpySession::GetKernelObjects( RArray &aKernelObjects ) + { + TPckgBuf count; + TInt error = SendReceive( EGetKernelObjectTypeCount, TIpcArgs(&count) ); + + if( error == KErrNone ) + { + TInt requestedCount = count(); + HBufC8* buffer = HBufC8::NewLC(requestedCount * sizeof(TMemSpyKernelObjectData)); + TPtr8 bufferPtr(buffer->Des()); + + TPckgBuf count(requestedCount); + TIpcArgs args( &count, &bufferPtr ); + TInt error = SendReceive( EGetKernelObjects, args ); + + for(TInt i=0, offset = 0; i data; + data.Copy(bufferPtr.Ptr()+offset, sizeof(TMemSpyKernelObjectData)); + aKernelObjects.AppendL(CMemSpyApiKernelObject::NewL(data())); + } + + CleanupStack::PopAndDestroy(buffer); + } + return KErrNone; + } + +EXPORT_C TInt RMemSpySession::GetKernelObjectItems( RArray &aKernelObjectItems, TMemSpyDriverContainerType aForContainer ) + { + TPckgBuf count; + TPckgBuf type(aForContainer); + TInt error = SendReceive( EGetKernelObjectItemsCount, TIpcArgs(&count, &type) ); + + if (error == KErrNone) + { + TInt requestedCount = count(); + HBufC8* buffer = HBufC8::NewLC(requestedCount * sizeof(TMemSpyDriverHandleInfoGeneric)); + TPtr8 bufferPtr(buffer->Des()); + + TPckgBuf count(requestedCount); + TIpcArgs args( &count, &type, &bufferPtr ); + TInt error = SendReceive( EGetKernelObjectItems, args ); + + for(TInt i=0, offset = 0; i data; + data.Copy(bufferPtr.Ptr()+offset, sizeof(TMemSpyDriverHandleInfoGeneric)); + aKernelObjectItems.AppendL( CMemSpyApiKernelObjectItem::NewL( data() ) ); + } + + CleanupStack::PopAndDestroy(buffer); + } + return KErrNone; + } + +//Heap specific operations +EXPORT_C CMemSpyApiHeap* RMemSpySession::GetHeap() + { + CMemSpyApiHeap* aHeap; + TInt error = KErrNone; + + HBufC8* buffer = HBufC8::NewLC( sizeof(TMemSpyHeapData) ); + TPtr8 bufferPtr(buffer->Des()); + TIpcArgs args( &bufferPtr ); + + error = SendReceive( EGetHeap, args ); + + if( error == KErrNone ) + { + TPckgBuf data; + data.Copy(bufferPtr.Ptr(), sizeof(TMemSpyHeapData)); + aHeap = CMemSpyApiHeap::NewL( data() ); + } + CleanupStack::PopAndDestroy(buffer); + + return aHeap; + } diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/MemSpyServer/Include/MemSpyServer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/memspy/MemSpyServer/Include/MemSpyServer.h Fri May 14 17:25:03 2010 +0300 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* MemSpyServer headder file to declare MemSpyServer class +* +*/ + +#ifndef MEMSPYSERVER_H +#define MEMSPYSERVER_H + +// System includes +#include + +#include + +// User includes +#include + +// Classes referenced +class CMemSpyEngine; + +// Literal constants +//_LIT( KMemSpyServer2, "MemSpyServer.exe" ); + +// MemSpyServer class declaration +NONSHARABLE_CLASS( CMemSpyServer ) : public CServer2 + { + public: + static CMemSpyServer* NewL( CMemSpyEngine& aEngine ); + static CMemSpyServer* NewLC( CMemSpyEngine& aEngine ); + ~CMemSpyServer(); + + private: + CMemSpyServer( CMemSpyEngine& aEngine ); + void ConstructL(); + + protected: // From CServer2 + CSession2* NewSessionL(const TVersion& aVersion, const RMessage2& aMessage) const; + + private: + CMemSpyEngine& iEngine; + + RFileLogger iLog; + }; + +#endif diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/MemSpyServer/Include/MemSpyServerSession.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/memspy/MemSpyServer/Include/MemSpyServerSession.h Fri May 14 17:25:03 2010 +0300 @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* MemSpyServer headder file to declare MemSpyServer class +* +*/ + +#ifndef MEMSPYSERVERSESSION_H +#define MEMSPYSERVERSESSION_H + +// System includes +#include +#include + +// User includes +#include +#include + + // Classes referenced +class CMemSpyEngine; + + +NONSHARABLE_CLASS( CMemSpyServerSession ) : public CSession2 + { +public: + static CMemSpyServerSession* NewL( CMemSpyEngine& aEngine, const RMessage2& aMessage ); + ~CMemSpyServerSession(); + +private: + CMemSpyServerSession( CMemSpyEngine& aEngine ); + void ConstructL( const RMessage2& aMessage ); + +private: // From CSession2 + void ServiceL( const RMessage2& aMessage ); + +private: // Internal methods + void DoServiceL( const RMessage2& aMessage ); + static TInt ValidateFunction( TInt aFunction, TBool aIncludesThreadId, TBool aIncludesThreadName ); + void HandleThreadSpecificOpL( TInt aFunction, const TThreadId& aThreadId ); + void HandleThreadSpecificOpL( TInt aFunction, const TDesC& aThreadName ); + void HandleThreadAgnosticOpL( TInt aFunction, const RMessage2& aMessage ); + +private: + CMemSpyEngine& iEngine; + HBufC* iClientThreadName; + TUint32 iClientThreadId; + }; + +#endif diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/MemSpyServer/Source/MemSpyServer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/memspy/MemSpyServer/Source/MemSpyServer.cpp Fri May 14 17:25:03 2010 +0300 @@ -0,0 +1,124 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Implementation of the new MemSpyServer +*/ + +//user includes +#include "MemSpyServer.h" +#include "MemSpyServerSession.h" + +// System includes +#include + +// User includes +#include +#include +//#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +// --------------------------------------------------------- +// CMemSpyServer( CMemSpyEngine& aEngine ) +// --------------------------------------------------------- +// +CMemSpyServer::CMemSpyServer( CMemSpyEngine& aEngine ) +: CServer2( EPriorityNormal ), iEngine( aEngine ) + { + } + +// --------------------------------------------------------- +// ~CMemSpyServer() +// --------------------------------------------------------- +// +CMemSpyServer::~CMemSpyServer() + { + iLog.CloseLog(); + iLog.Close(); + } + +// --------------------------------------------------------- +// ConstructL() +// --------------------------------------------------------- +// +void CMemSpyServer::ConstructL() + { + StartL( KMemSpyServer2 ); + //TInt error = Start( KMemSpyServerName ); + RDebug::Printf( "[MemSpy] CMemSpyServer::ConstructL() - server started" ); + + iLog.Connect(); + iLog.CreateLog(_L("memspy"), _L("server.txt"), EFileLoggingModeAppend); + iLog.Write(_L("[MemSpy] CMemSpyServer::ConstructL() - server started")); + iLog.Write(_L("[MemSpy] CMemSpyServer::ConstructL() - server name: ")); + iLog.Write(KMemSpyServer2); + } + +// --------------------------------------------------------- +// NewL( CMemSpyEngine& aEngine ) +// Two phased constructor +// --------------------------------------------------------- +// +CMemSpyServer* CMemSpyServer::NewL( CMemSpyEngine& aEngine ) + { + CMemSpyServer* self = CMemSpyServer::NewLC(aEngine); + CleanupStack::Pop(self); + return (self); + } + +// --------------------------------------------------------- +// NewLC( CMemSpyEngine& aEngine ) +// Two phased constructor +// --------------------------------------------------------- +// +CMemSpyServer* CMemSpyServer::NewLC( CMemSpyEngine& aEngine ) + { + CMemSpyServer* self = new(ELeave) CMemSpyServer( aEngine ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------- +// NewSessionL( const TVersion& aVersion, const RMessage2& aMessage ) +// Creates new client server session +// --------------------------------------------------------- +// +CSession2* CMemSpyServer::NewSessionL( const TVersion& aVersion, const RMessage2& aMessage ) const + { + if ( aVersion.iMajor != KMemSpyClientServerVersion ) + { + RDebug::Printf( "[MemSpy] CMemSpyServerSession::NewSessionL() - BAD VERSION" ); + User::Leave( KErrNotSupported ); + } + // + CMemSpyServerSession* session = CMemSpyServerSession::NewL( iEngine, aMessage ); + return session; + } + +// END OF FILE diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/MemSpyServer/Source/MemSpyServerMain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/memspy/MemSpyServer/Source/MemSpyServerMain.cpp Fri May 14 17:25:03 2010 +0300 @@ -0,0 +1,78 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* MemSpyServer Main class +*/ + +// System includes +#include +#include +#include + +// Engine includes +#include + +// User includes +#include "MemSpyServer.h" + +static void RunServerL() + { + // Scheduler + CActiveScheduler* scheduler = new (ELeave) CActiveScheduler(); + CleanupStack::PushL( scheduler ); + CActiveScheduler::Install( scheduler ); + + // F32 + RFs fsSession; + User::LeaveIfError(fsSession.Connect()); + CleanupClosePushL(fsSession); + + // MemSpyEngine initialization + CMemSpyEngine* engine = CMemSpyEngine::NewL(fsSession); + CleanupStack::PushL(engine); + + // MemSpyServer initialization + CMemSpyServer::NewLC(*engine); + + // Play nicely with external processes + RProcess::Rendezvous( KErrNone ); + + // Start wait loop. + CActiveScheduler::Start(); + + // Tidy up + CleanupStack::PopAndDestroy( 4, scheduler ); + } + +TInt E32Main() + { + __UHEAP_MARK; + + CTrapCleanup* cleanupTrap = CTrapCleanup::New(); + + TInt r = KErrNoMemory; + if ( cleanupTrap ) + { + TRAPD(err, RunServerL()); + if ( err != KErrNone ) + { + RDebug::Print(_L("[MemSpyCmdLine] E32Main() - MemSpyServer - error: %d"), err); + } + delete cleanupTrap; + } + + __UHEAP_MARKEND; + + return r; + } diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/MemSpyServer/Source/MemSpyServerSession.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/memspy/MemSpyServer/Source/MemSpyServerSession.cpp Fri May 14 17:25:03 2010 +0300 @@ -0,0 +1,949 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Implementation of the new MemSpyServer +*/ + +// System includes +#include +#include +#include +#include +//#include +//#include + +//user includes +#include "MemSpyServerSession.h" + +// User includes +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +//cigasto +#include +//#include + +// --------------------------------------------------------- +// CMemSpyServerSession( CMemSpyEngine& aEngine ) +// --------------------------------------------------------- +// +CMemSpyServerSession::CMemSpyServerSession( CMemSpyEngine& aEngine ) +: iEngine( aEngine ) + { + } + +// --------------------------------------------------------- +// ~CMemSpyServerSession() +// --------------------------------------------------------- +// +CMemSpyServerSession::~CMemSpyServerSession() + { +#ifdef _DEBUG + TPtrC pThreadName( KNullDesC ); + if ( iClientThreadName ) + { + pThreadName.Set( *iClientThreadName ); + } + + RDebug::Print( _L("[MemSpy] CMemSpyServerSession::~CMemSpyServerSession() - DEAD SESSION - this: 0x%08x, id: %4d, name: %S"), this, iClientThreadId, iClientThreadName ); +#endif + + delete iClientThreadName; + } + +// --------------------------------------------------------- +// ConstructL( const RMessage2& aMessage ) +// --------------------------------------------------------- +// +void CMemSpyServerSession::ConstructL( const RMessage2& aMessage ) + { + RThread thread; + const TInt error = aMessage.Client( thread ); + CleanupClosePushL( thread ); + + TRACE( RDebug::Printf( "[MemSpy] CMemSpyServerSession::ConstructL() - this: 0x%08x - opening client thread - err: %d", this, error ) ); + + User::LeaveIfError( error ); + + const TFullName threadName( thread.FullName() ); + iClientThreadName = threadName.AllocL(); + iClientThreadId = thread.Id(); + + CleanupStack::PopAndDestroy( &thread ); + + TRACE( RDebug::Print( _L("[MemSpy] CMemSpyServerSession::ConstructL() - NEW SESSION - this: 0x%08x, id: %4d, client: %S"), this, iClientThreadId, iClientThreadName ) ); + } + +// --------------------------------------------------------- +// NewL( CMemSpyEngine& aEngine, const RMessage2& aMessage ) +// Two-phased constructor +// --------------------------------------------------------- +// +CMemSpyServerSession* CMemSpyServerSession::NewL( CMemSpyEngine& aEngine, const RMessage2& aMessage ) + { + CMemSpyServerSession* self = new(ELeave) CMemSpyServerSession( aEngine ); + CleanupStack::PushL( self ); + self->ConstructL( aMessage ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------- +// ServiceL( const RMessage2& aMessage ) +// Method from which the clients request arrives +// --------------------------------------------------------- +// +void CMemSpyServerSession::ServiceL( const RMessage2& aMessage ) + { + TRACE( RDebug::Print( _L("[MemSpy] CMemSpyServerSession::ServiceL() - START - this: 0x%08x, fn: 0x%08x, id: %4d, client: %S"), this, aMessage.Function(), iClientThreadId, iClientThreadName ) ); + + TRAPD( error, DoServiceL( aMessage ) ); + if ( error != KErrNone ) + { + RDebug::Print( _L("[MemSpy] CMemSpyServerSession::ServiceL() - SERVICE ERROR - this: 0x%08x, fn: %d, err: %d, client: %S"), this, aMessage.Function(), error, iClientThreadName ); + } + aMessage.Complete( error ); + + TRACE( RDebug::Print( _L("[MemSpy] CMemSpyServerSession::ServiceL() - END - this: 0x%08x, fn: 0x%08x, id: %4d, client: %S"), this, aMessage.Function(), iClientThreadId, iClientThreadName ) ); + } + +// --------------------------------------------------------- +// DoServiceL( const RMessage2& aMessage ) +// --------------------------------------------------------- +// +void CMemSpyServerSession::DoServiceL( const RMessage2& aMessage ) + { + TInt error = KErrNone; + + // Check function attributes + const TInt function = aMessage.Function() & KMemSpyOpFlagsTypeMask; + const TInt argSpec = aMessage.Function() & KMemSpyOpFlagsInclusionMask; + const TBool byThreadId = ( argSpec == KMemSpyOpFlagsIncludesThreadId ); + const TBool byThreadName = ( argSpec == KMemSpyOpFlagsIncludesThreadName ); + + TRACE( RDebug::Printf( "[MemSpy] CMemSpyServerSession::DoServiceL() - START - unmodified function: 0x%08x, opCode: %d [TID: %d, TN: %d]", aMessage.Function(), function, byThreadId, byThreadName ) ); + + switch (function) + { + case EGetProcessCount: + { + aMessage.WriteL(0, TPckgBuf(iEngine.Container().Count())); + break; + } + case EGetProcesses: + { + CMemSpyEngineObjectContainer& list = iEngine.Container(); + + TPckgBuf a0; + aMessage.ReadL(0, a0); + TInt realCount = Min(a0(), list.Count()); + + for(TInt i=0, offset = 0; i buffer(data); + aMessage.WriteL(1, buffer, offset); + } + + a0 = list.Count(); + aMessage.WriteL(0, a0); + + break; + } + case EProcessSystemPermanentOrCritical: + { + TBool ret = EFalse; + TPckgBuf id; + aMessage.ReadL( 0, id ); + + CMemSpyEngineObjectContainer& container = iEngine.Container(); + CMemSpyProcess& process = container.ProcessByIdL( id() ); + + process.Open(); + + if ( process.IsSystemPermanent() || process.IsSystemCritical() ) + { + ret = ETrue; + } + TPckgBuf retBuf( ret ); + aMessage.WriteL( 1, retBuf ); + + break; + } + case EEndProcess: + { + TPckgBuf id; + aMessage.ReadL( 0, id ); + TPckgBuf type; + aMessage.ReadL( 1, type ); + + CMemSpyEngineObjectContainer& container = iEngine.Container(); + CMemSpyProcess& process = container.ProcessByIdL( id() ); + + switch ( type() ) + { + case ETerminate: + { + process.TerminateL(); + break; + } + case EPanic: + { + process.PanicL(); + break; + } + case EKill: + { + process.KillL(); + break; + } + } + break; + } + case ESwitchToProcess: + {/* + TInt wgCount; + RWsSession wsSession; + User::LeaveIfError( wsSession.Connect() ); + CleanupClosePushL( wsSession ); + User::LeaveIfError( wgCount = wsSession.NumWindowGroups() ); + RArray wgArray; + CleanupClosePushL( wgArray ); + User::LeaveIfError( wsSession.WindowGroupList( &wgArray ) ); + TApaTask task( wsSession ); + TBool brought( EFalse ); + TInt wgId( KErrNotFound ); + TThreadId threadId; + + TPckgBuf id; + aMessage.ReadL( 0, id ); + CMemSpyEngineObjectContainer& container = iEngine.Container(); + CMemSpyProcess& process = container.ProcessByIdL( id() ); + + // loop trough threads in a process + for ( TInt i = 0; i < process.MdcaCount(); i++ ) + { + TInt wgCountLocal = wgCount; + + // loop trough all window groups and see if a thread id matches + while( !brought && wgCountLocal-- ) + { + wgId = wgArray[wgCountLocal].iId; + User::LeaveIfError( wsSession.GetWindowGroupClientThreadId( wgId, threadId ) ); + if ( threadId == process.At( i ).Id() ) + { + CApaWindowGroupName* wgName = CApaWindowGroupName::NewLC( wsSession, wgId ); + task.SetWgId( wgId ); + if ( !wgName->Hidden() && task.Exists() ) + { + task.BringToForeground(); + brought = ETrue; + } + CleanupStack::PopAndDestroy( wgName ); + } + } + } + + TPckgBuf ret( brought ); + aMessage.WriteL( 1, ret ); + + break;*/ + } + case EGetThreadCount: + { + TPckgBuf pid; + aMessage.ReadL(1, pid); + CMemSpyProcess& process = iEngine.Container().ProcessByIdL(pid()); + process.Open(); + aMessage.WriteL(0, TPckgBuf(process.Count())); + process.Close(); + break; + } + case EGetThreads: + { + TPckgBuf pid; + aMessage.ReadL(2, pid); + + CMemSpyProcess& list = iEngine.Container().ProcessByIdL(pid()); + list.Open(); + + TPckgBuf a0; + aMessage.ReadL(0, a0); + TInt realCount = Min(a0(), list.Count()); + + for(TInt i=0, offset = 0; i buffer(data); + aMessage.WriteL(1, buffer, offset); + + thread.Close(); + } + + a0 = list.Count(); + aMessage.WriteL(0, a0); + + list.Close(); + + break; + } + case ESetThreadPriority: + { + TPckgBuf tid; + TPckgBuf priority; + aMessage.ReadL(0, tid); + aMessage.ReadL(1, priority); + + CMemSpyProcess* process = NULL; + CMemSpyThread* thread = NULL; + User::LeaveIfError(iEngine.Container().ProcessAndThreadByThreadId(tid(), process, thread)); + + if (thread) + { + thread->Open(); + thread->SetPriorityL(static_cast(priority())); + thread->Close(); + } + break; + } + case EThreadSystemPermanentOrCritical: + { + TBool ret = EFalse; + TPckgBuf id; + aMessage.ReadL( 0, id ); + + CMemSpyEngineObjectContainer& container = iEngine.Container(); + CMemSpyProcess* process = NULL; + CMemSpyThread* thread = NULL; + User::LeaveIfError( container.ProcessAndThreadByThreadId( id(), process, thread ) ); + + if ( thread ) + { + thread->Open(); + + if ( thread->IsSystemPermanent() || thread->IsSystemCritical() ) + { + ret = ETrue; + } + thread->Close(); + } + TPckgBuf retBuf( ret ); + aMessage.WriteL( 1, retBuf ); + + break; + } + case EEndThread: + { + TPckgBuf id; + aMessage.ReadL( 0, id ); + TPckgBuf type; + aMessage.ReadL( 1, type ); + + CMemSpyEngineObjectContainer& container = iEngine.Container(); + CMemSpyProcess* process = NULL; + CMemSpyThread* thread = NULL; + User::LeaveIfError( container.ProcessAndThreadByThreadId( id(), process, thread ) ); + + if( thread ) + { + switch ( type() ) + { + case ETerminate: + { + thread->TerminateL(); + break; + } + case EPanic: + { + thread->PanicL(); + break; + } + case EKill: + { + thread->KillL(); + break; + } + } + } + break; + } + // --- KernelObjects related functions --- + case EGetKernelObjectTypeCount: + { + TInt iCount = EMemSpyDriverContainerTypeChunk - EMemSpyDriverContainerTypeFirst; + //TInt iCount = EMemSpyDriverContainerTypeLast - EMemSpyDriverContainerTypeFirst; + TPckgBuf ret( iCount ); + aMessage.WriteL(0, ret); + break; + } + case EGetKernelObjects: + { + TPckgBuf count; + aMessage.ReadL(0, count); + + CMemSpyEngineGenericKernelObjectContainer* model = iEngine.HelperKernelContainers().ObjectsAllL(); //contains all the objects + CleanupStack::PushL( model ); + + for( TInt i=0, offset = 0; iAt(i).Name() ); + data.iType = model->At(i).Type(); + data.iCount = model->At(i).Count(); + data.iSize = model->At(i).Count() * model->At(i).Count(); + + TPckgBuf buffer(data); + aMessage.WriteL(1, buffer, offset); + } + aMessage.WriteL(0, count); + CleanupStack::PopAndDestroy( model ); + break; + } + case EGetKernelObjectItemsCount: + { + TPckgBuf tempType; + aMessage.ReadL(1, tempType); //get type of kernel object + TMemSpyDriverContainerType type = tempType(); + + CMemSpyEngineHelperKernelContainers& kernelContainerManager = iEngine.HelperKernelContainers(); + CMemSpyEngineGenericKernelObjectList* iObjectList = kernelContainerManager.ObjectsForSpecificContainerL( type ); + CleanupStack::PushL( iObjectList ); + + TInt count = iObjectList->Count(); + TPckgBuf ret( count ); + aMessage.WriteL( 0, ret ); + + CleanupStack::PopAndDestroy( iObjectList ); + break; + } + case EGetKernelObjectItems: + { + TPckgBuf count; + TPckgBuf tempType; + aMessage.ReadL( 0, count ); //get count of items + aMessage.ReadL(1, tempType); //get type of kernel object + TInt c = count(); + + CMemSpyEngineHelperKernelContainers& kernelContainerManager = iEngine.HelperKernelContainers(); + CMemSpyEngineGenericKernelObjectList* iObjectList = kernelContainerManager.ObjectsForSpecificContainerL( tempType() ); + CleanupStack::PushL( iObjectList ); + + for( TInt i=0, offset = 0; iAt( i ); + + TPckgBuf buffer(data); + aMessage.WriteL(2, buffer, offset); + } + + CleanupStack::PopAndDestroy( iObjectList ); + break; + } + // --- Kernel Heap related functions --- + case EGetHeap: + { + TMemSpyHeapInfo heapInfo; + iEngine.HelperHeap().GetHeapInfoKernelL( heapInfo ); + TMemSpyHeapData data = iEngine.HelperHeap().NewHeapRawInfo( heapInfo ); + + TPckgBuf buffer(data); + aMessage.WriteL(0, buffer); + + break; + } + } +// else if( function == EProcessByIndex ) +// { +// TMemSpyProcess iProcess; +// TInt in; +// TPckgBuf index( in ); +// aMessage.ReadL( 0, index ); +// CMemSpyProcess& process = iEngine.Container().At( index() ); +// //fill the data structure +// iProcess.iId = process.Id(); //process ID +// iProcess.iName.Append( process.Name() ); //raw process name +// iProcess.iThreadCount = process.Count(); //thread count +// iProcess.iPriority = process.Priority(); +// // +// TPckgBuf buf( iProcess ); +// aMessage.WriteL( 1, buf ); +// aMessage.Complete( KErrNone ); +// } +// else if( function == EProcessIndexById ) +// { +// TProcessId iId; +// TPckgBuf buf( iId ); +// aMessage.ReadL( 0, buf ); +// TInt index = iEngine.Container().ProcessIndexById( buf() ); +// TPckgBuf out( index ); +// aMessage.WriteL( 1, out ); +// aMessage.Complete( KErrNone ); +// } +// else if( function == EOutputProcessInfo ) +// { +// TProcessId iId; +// TPckgBuf buf( iId ); +// aMessage.ReadL( 0, buf ); +// CMemSpyProcess& process = iEngine.Container().ProcessByIdL( buf() ); +// iEngine.HelperProcess().OutputProcessInfoL( process ); +// } +// else if( function == EProcessIsDead ) +// { +// TProcessId iId; +// TPckgBuf buf( iId ); +// aMessage.ReadL( 0, buf ); +// CMemSpyProcess& process = iEngine.Container().ProcessByIdL( buf() ); +// TBool dead = process.IsDead(); +// TPckgBuf out( dead ); +// aMessage.WriteL( 1, out ); +// aMessage.Complete( KErrNone ); +// } +// else if( function == ESortProcessesBy ) +// { +// TSortType type; +// TPckgBuf buf(type); +// aMessage.ReadL( 0, buf ); +// if( buf() == ESortProcById ) +// { +// iEngine.Container().SortById(); +// } +// else if( buf() == ESortProcByName ) +// { +// iEngine.Container().SortByName(); +// } +// else if( buf() == ESortProcByThreadCount ) +// { +// iEngine.Container().SortByThreadCount(); +// } +// else if( buf() == ESortProcByCodeSegs ) +// { +// iEngine.Container().SortByCodeSegs(); +// } +// else if( buf() == ESortProcByHeapUsage ) +// { +// iEngine.Container().SortByHeapUsage(); +// } +// else if( buf() == ESortProcByStackUsage ) +// { +// iEngine.Container().SortByStackUsage(); +// } +// } +// else if( function == EOpenCloseCurrentProcess ) +// { +// TProcessId id; +// TBool open; +// TPckgBuf buf(id); +// TPckgBuf buf2(open); +// aMessage.ReadL( 0, buf ); +// aMessage.ReadL( 1, buf2 ); +// if( buf2() == 1 ) +// { +// iEngine.Container().ProcessByIdL( buf() ).Open(); +// } +// else +// { +// iEngine.Container().ProcessByIdL( buf() ).Close(); +// } +// } + +// // Check function is supported and argument combination is valid +// error = ValidateFunction( function, byThreadId, byThreadName ); +// TRACE( RDebug::Printf( "[MemSpy] CMemSpyServerSession::DoServiceL() - validation result: %d", error ) ); +// +// // Process function request +// if ( error == KErrNone ) +// { +// if ( byThreadId ) +// { +// TRACE( RDebug::Printf( "[MemSpy] CMemSpyServerSession::DoServiceL() - [TID] thread-specific..." ) ); +// +// const TThreadId threadId( aMessage.Int0() ); +// HandleThreadSpecificOpL( function, threadId ); +// } +// else if ( byThreadName ) +// { +// TRACE( RDebug::Printf( "[MemSpy] CMemSpyServerSession::DoServiceL() - [TN] thread-specific..." ) ); +// +// error = aMessage.GetDesLength( 0 /*slot 0*/ ); +// +// if ( error > 0 && error <= KMaxFullName ) +// { +// TFullName* threadName = new(ELeave) TFullName(); +// CleanupStack::PushL( threadName ); +// aMessage.ReadL( 0, *threadName ); +// HandleThreadSpecificOpL( function, *threadName ); +// CleanupStack::PopAndDestroy( threadName ); +// } +// else +// { +// error = KErrArgument; +// } +// } +// else +// { +// TRACE( RDebug::Printf( "[MemSpy] CMemSpyServerSession::DoServiceL() - thread-agnostic..." ) ); +// +// HandleThreadAgnosticOpL( function, aMessage ); +// } +// } + + User::LeaveIfError( error ); + + TRACE( RDebug::Printf( "[MemSpy] CMemSpyServerSession::DoServiceL() - HELLOOOOOO" ) ); + TRACE( RDebug::Printf( "[MemSpy] CMemSpyServerSession::DoServiceL() - END" ) ); + } + +// --------------------------------------------------------- +// ValidateFunction( TInt aFunction, TBool aIncludesThreadId, TBool aIncludesThreadName ) +// Validates the MemSpy operation types +// --------------------------------------------------------- +// +TInt CMemSpyServerSession::ValidateFunction( TInt aFunction, TBool aIncludesThreadId, TBool aIncludesThreadName ) + { + TInt err = KErrNotSupported; + + // Check the operation is within op-code range + if ( aFunction >= EMemSpyClientServerOpMarkerFirst && aFunction < EMemSpyClientServerOpMarkerLast ) + { + // Check the operation doesn't include unnecessary or not supported information + const TBool includesThreadIdentifier = ( aIncludesThreadId || aIncludesThreadName ); + if ( includesThreadIdentifier && aFunction >= EMemSpyClientServerOpMarkerThreadAgnosticFirst ) + { + // Passing a thread identifier to a thread agnostic operation + err = KErrArgument; + } + else + { + err = KErrNone; + } + } + // + if ( err != KErrNone ) + { + RDebug::Printf( "[MemSpy] CMemSpyServerSession::ValidateFunction() - function request did not validate - [withId: %d, withName: %d]", aIncludesThreadId, aIncludesThreadName ); + } + // + return err; + } + +// --------------------------------------------------------- +// HandleThreadSpecificOpL( TInt aFunction, const TThreadId& aThreadId ) +// --------------------------------------------------------- +// +void CMemSpyServerSession::HandleThreadSpecificOpL( TInt aFunction, const TThreadId& aThreadId ) + { +// TRACE( RDebug::Printf( "[MemSpy] CMemSpyServerSession::HandleThreadSpecificOpL() - START - aFunction: %d, aThreadId: %d", aFunction, (TUint) aThreadId ) ); +// +// ASSERT( (TUint) aThreadId != 0 ); +// TInt error = KErrNone; +// +// // Check if its a kernel thread identifier +// const TBool isKernel = ( static_cast( aThreadId ) == KMemSpyClientServerThreadIdKernel ); +// +// // Treat as thread specific operation +// CMemSpyProcess* process = NULL; +// CMemSpyThread* thread = NULL; +// if ( !isKernel ) +// { +// error = iEngine.Container().ProcessAndThreadByThreadId( aThreadId, process, thread ); +// TRACE( RDebug::Printf( "[MemSpy] CMemSpyServerSession::HandleThreadSpecificOpL() - search result: %d, proc: 0x%08x, thread: 0x%08x", error, process, thread ) ); +// } +// else +// { +// // Kernel is only supported for a couple of operations +// if ( aFunction == EMemSpyClientServerOpHeapInfo || aFunction == EMemSpyClientServerOpHeapData ) +// { +// } +// else +// { +// TRACE( RDebug::Printf( "[MemSpy] CMemSpyServerSession::HandleThreadSpecificOpL() - trying to call unsupported function for kernel thread!" ) ); +// error = KErrArgument; +// } +// } +// +// // Must be no error so far and we must have a valid thread & process when performing a non-kernel op +// // or then if we are performing a kernel op, we don't need the thread or process. +// if ( error == KErrNone && ( ( thread && process && !isKernel ) || ( isKernel ) ) ) +// { +//#ifdef _DEBUG +// if ( thread ) +// { +// HBufC* threadName = thread->FullName().AllocLC(); +// _LIT( KTrace2, "[MemSpy] CMemSpyServerSession::HandleThreadSpecificOpL() - thread: %S" ); +// RDebug::Print( KTrace2, threadName ); +// CleanupStack::PopAndDestroy( threadName ); +// } +// else if ( isKernel ) +// { +// _LIT( KTrace2, "[MemSpy] CMemSpyServerSession::HandleThreadSpecificOpL() - thread: Kernel" ); +// RDebug::Print( KTrace2 ); +// } +//#endif +// +// // Got a valid thread object - now work out which operation to perform... +// switch( aFunction ) +// { +// case EMemSpyClientServerOpSummaryInfo: +// iEngine.HelperProcess().OutputProcessInfoL( *process ); +// break; +// case EMemSpyClientServerOpSummaryInfoDetailed: +// iEngine.HelperProcess().OutputProcessInfoDetailedL( *process ); +// break; +// case EMemSpyClientServerOpHeapInfo: +// if ( isKernel ) +// { +// iEngine.HelperHeap().OutputHeapInfoKernelL(); +// } +// else +// { +// iEngine.HelperHeap().OutputHeapInfoUserL( *thread ); +// } +// break; +// case EMemSpyClientServerOpHeapCellListing: +// iEngine.HelperHeap().OutputCellListingUserL( *thread ); +// break; +// case EMemSpyClientServerOpHeapData: +// if ( isKernel ) +// { +// iEngine.HelperHeap().OutputHeapDataKernelL(); +// } +// else +// { +// iEngine.HelperHeap().OutputHeapDataUserL( *thread ); +// } +// break; +// case EMemSpyClientServerOpStackInfo: +// iEngine.HelperStack().OutputStackInfoL( *thread ); +// break; +// case EMemSpyClientServerOpStackDataUser: +// iEngine.HelperStack().OutputStackDataL( *thread, EMemSpyDriverDomainUser, EFalse ); +// break; +// case EMemSpyClientServerOpStackDataKernel: +// iEngine.HelperStack().OutputStackDataL( *thread, EMemSpyDriverDomainKernel, EFalse ); +// break; +// case EMemSpyClientServerOpOpenFiles: +// iEngine.HelperFileSystem().ListOpenFilesL( aThreadId ); +// break; +// +// default: +// error = KErrNotSupported; +// break; +// } +// } +// +// TRACE( RDebug::Printf("[MemSpy] CMemSpyServerSession::HandleThreadSpecificOpL() - END - aFunction: %d, aThreadId: %d, error: %d", aFunction, (TUint) aThreadId, error ) ); +// User::LeaveIfError( error ); + } + +// --------------------------------------------------------- +// HandleThreadSpecificOpL( TInt aFunction, const TDesC& aThreadName ) +// Gets thread ID from aThreadName +// and calls HandleThreadSpecificOpL( , const TThreadId& aThreadId ) +// --------------------------------------------------------- +// +void CMemSpyServerSession::HandleThreadSpecificOpL( TInt aFunction, const TDesC& aThreadName ) + { +// TRACE( RDebug::Print( _L("[MemSpy] CMemSpyServerSession::HandleThreadSpecificOpL() - START - aFunction: %d, aThreadName: %S"), aFunction, &aThreadName ) ); +// // +// CMemSpyProcess* process = NULL; +// CMemSpyThread* thread = NULL; +// TInt error = iEngine.Container().ProcessAndThreadByPartialName( aThreadName, process, thread ); +// User::LeaveIfError( error ); +// // +// const TThreadId threadId( thread->Id() ); +// HandleThreadSpecificOpL( aFunction, threadId ); +// // +// TRACE( RDebug::Print( _L("[MemSpy] CMemSpyServerSession::HandleThreadSpecificOpL() - END - aFunction: %d, aThreadName: %S"), aFunction, &aThreadName ) ); + } + +// --------------------------------------------------------- +// HandleThreadAgnosticOpL( TInt aFunction, const RMessage2& aMessage ) +// --------------------------------------------------------- +// +void CMemSpyServerSession::HandleThreadAgnosticOpL( TInt aFunction, const RMessage2& aMessage ) + { +// TRACE( RDebug::Printf("[MemSpy] CMemSpyServerSession::HandleThreadAgnosticOpL() - START" ) ); +// // +// if ( aFunction == EMemSpyClientServerOpHeapInfoCompact ) +// { +// TRACE( RDebug::Printf("[MemSpy] CMemSpyServerSession::HandleThreadAgnosticOpL() - EMemSpyClientServerOpHeapInfoCompact") ); +// iEngine.HelperHeap().OutputHeapInfoForDeviceL(); +// } +// else if ( aFunction == EMemSpyClientServerOpStackInfoCompact ) +// { +// TRACE( RDebug::Printf("[MemSpy] CMemSpyServerSession::HandleThreadAgnosticOpL() - EMemSpyClientServerOpStackInfoCompact") ); +// iEngine.HelperStack().OutputStackInfoForDeviceL(); +// } +// else if ( aFunction == EMemSpyClientServerOpSystemWideMemoryTrackingTimerStart ) +// { +// TRACE( RDebug::Printf("[MemSpy] CMemSpyServerSession::HandleThreadAgnosticOpL() - EMemSpyClientServerOpSystemWideMemoryTrackingTimerStart") ); +// iEngine.HelperSysMemTracker().StartL(); +// } +// else if ( aFunction == EMemSpyClientServerOpSystemWideMemoryTrackingTimerStop ) +// { +// TRACE( RDebug::Printf("[MemSpy] CMemSpyServerSession::HandleThreadAgnosticOpL() - EMemSpyClientServerOpSystemWideMemoryTrackingTimerStop") ); +// iEngine.HelperSysMemTracker().StopL(); +// } +// else if ( aFunction == EMemSpyClientServerOpSystemWideMemoryTrackingReset ) +// { +// TRACE( RDebug::Printf("[MemSpy] CMemSpyServerSession::HandleThreadAgnosticOpL() - EMemSpyClientServerOpSystemWideMemoryTrackingReset") ); +// iEngine.HelperSysMemTracker().Reset(); +// } +// else if ( aFunction == EMemSpyClientServerOpSystemWideMemoryTrackingForceUpdate ) +// { +// TRACE( RDebug::Printf("[MemSpy] CMemSpyServerSession::HandleThreadAgnosticOpL() - EMemSpyClientServerOpSystemWideMemoryTrackingForceUpdate") ); +// iEngine.HelperSysMemTracker().CheckForChangesNowL(); +// } +// else if ( aFunction == EMemSpyClientServerOpSystemWideMemoryTrackingTimerPeriodSet ) +// { +// TRACE( RDebug::Printf("[MemSpy] CMemSpyServerSession::HandleThreadAgnosticOpL() - EMemSpyClientServerOpSystemWideMemoryTrackingTimerPeriodSet") ); +// +// // Get current config +// TMemSpyEngineHelperSysMemTrackerConfig config; +// iEngine.HelperSysMemTracker().GetConfig( config ); +// +// // Set new timer value +// config.iTimerPeriod = aMessage.Int0(); +// +// // And update config... which will leave if the config is invalid +// iEngine.HelperSysMemTracker().SetConfigL( config ); +// } +// else if ( aFunction == EMemSpyClientServerOpSystemWideMemoryTrackingCategoriesSet ) +// { +// TRACE( RDebug::Printf("[MemSpy] CMemSpyServerSession::HandleThreadAgnosticOpL() - EMemSpyClientServerOpSystemWideMemoryTrackingCategoriesSet") ); +// // Get current config +// TMemSpyEngineHelperSysMemTrackerConfig config; +// iEngine.HelperSysMemTracker().GetConfig( config ); +// +// // Set new categories +// config.iEnabledCategories = aMessage.Int0(); +// +// // And update config... which will leave if the config is invalid +// iEngine.HelperSysMemTracker().SetConfigL( config ); +// } +// else if ( aFunction == EMemSpyClientServerOpSystemWideMemoryTrackingThreadNameFilterSet ) +// { +// TRACE( RDebug::Printf("[MemSpy] CMemSpyServerSession::HandleThreadAgnosticOpL() - EMemSpyClientServerOpSystemWideMemoryTrackingThreadNameFilterSet") ); +// // Get current config +// TMemSpyEngineHelperSysMemTrackerConfig config; +// iEngine.HelperSysMemTracker().GetConfig( config ); +// +// // Set new filter +// RBuf buf; +// buf.CleanupClosePushL(); +// TInt len = aMessage.GetDesLength( 0 ); +// if ( len > 0 ) +// { +// buf.CreateL( len ); +// aMessage.ReadL( 0, buf, 0 ); +// config.iThreadNameFilter.Copy( buf ); +// } +// else +// { +// config.iThreadNameFilter.Zero(); +// } +// CleanupStack::PopAndDestroy( &buf ); +// +// // And update config... which will leave if the config is invalid +// iEngine.HelperSysMemTracker().SetConfigL( config ); +// } +// else if ( aFunction == EMemSpyClientServerOpSystemWideMemoryTrackingHeapDumpSet ) +// { +// // Get current config +// TMemSpyEngineHelperSysMemTrackerConfig config; +// iEngine.HelperSysMemTracker().GetConfig( config ); +// +// // Set new Heap Dump value +// config.iDumpData = aMessage.Int0(); +// +// // And update config... which will leave if the config is invalid +// iEngine.HelperSysMemTracker().SetConfigL( config ); +// } +// else if ( aFunction == EMemSpyClientServerOpSwitchOutputSinkTrace ) +// { +// TRACE( RDebug::Printf("[MemSpy] CMemSpyServerSession::HandleThreadAgnosticOpL() - EMemSpyClientServerOpSwitchOutputSinkTrace") ); +// iEngine.InstallSinkL( ESinkTypeDebug ); +// } +// else if ( aFunction == EMemSpyClientServerOpSwitchOutputSinkFile ) +// { +// TRACE( RDebug::Printf("[MemSpy] CMemSpyServerSession::HandleThreadAgnosticOpL() - EMemSpyClientServerOpSwitchOutputSinkFile") ); +// iEngine.InstallSinkL( ESinkTypeFile ); +// } +// else if ( aFunction == EMemSpyClientServerOpEnumerateKernelContainer ) +// { +// const TMemSpyDriverContainerType type = CMemSpyEngineHelperKernelContainers::MapToType( static_cast< TObjectType >( aMessage.Int0() ) ); +// +// TRACE( RDebug::Printf("[MemSpy] CMemSpyServerSession::HandleThreadAgnosticOpL() - EMemSpyClientServerOpEnumerateKernelContainer - type: %d", type ) ); +// +// CMemSpyEngineGenericKernelObjectList* model = iEngine.HelperKernelContainers().ObjectsForSpecificContainerL( type ); +// CleanupStack::PushL( model ); +// model->OutputL( iEngine.Sink() ); +// CleanupStack::PopAndDestroy( model ); +// } +// else if ( aFunction == EMemSpyClientServerOpEnumerateKernelContainerAll ) +// { +// TRACE( RDebug::Printf("[MemSpy] CMemSpyServerSession::HandleThreadAgnosticOpL() - EMemSpyClientServerOpEnumerateKernelContainerAll") ); +// CMemSpyEngineGenericKernelObjectContainer* model = iEngine.HelperKernelContainers().ObjectsAllL(); +// CleanupStack::PushL( model ); +// model->OutputL( iEngine.Sink() ); +// CleanupStack::PopAndDestroy( model ); +// } +// else if ( aFunction == EMemSpyClientServerOpOpenFiles ) +// { +// TRACE( RDebug::Printf("[MemSpy] CMemSpyServerSession::HandleThreadAgnosticOpL() - EMemSpyClientServerOpOpenFiles") ); +// iEngine.ListOpenFilesL(); +// } +// else if ( aFunction == EMemSpyClientServerOpDisableAknIconCache ) +// { +// TRACE( RDebug::Printf("[MemSpy] CMemSpyServerSession::HandleThreadAgnosticOpL() - EMemSpyClientServerOpDisableAknIconCache") ); +// iEngine.HelperRAM().SetAknIconCacheStatusL( EFalse ); +// } +// else +// { +// TRACE( RDebug::Printf("[MemSpy] CMemSpyServerSession::HandleThreadAgnosticOpL() - [device-wide operation] => invoking UI") ); +// iEngine.NotifyClientServerOperationRequestL( aFunction ); +// } +// // +// TRACE( RDebug::Printf("[MemSpy] CMemSpyServerSession::HandleThreadAgnosticOpL() - END" ) ); + } diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/MemSpyServer/group/MemSpyServer.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/memspy/MemSpyServer/group/MemSpyServer.mmp Fri May 14 17:25:03 2010 +0300 @@ -0,0 +1,56 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include +#include + +TARGETTYPE EXE +TARGET MemSpyServer.exe +EPOCSTACKSIZE 0x4000 +EPOCHEAPSIZE 0x100000 0x4000000 +UID 0 0x2002EA8D +SECUREID 0xE5883BC2 +VENDORID 0x101FB657 // Nokia + +SOURCEPATH ../Source +SOURCE MemSpyServer.cpp +SOURCE MemSpyServerSession.cpp +SOURCE MemSpyServerMain.cpp + +USERINCLUDE ../Include + +CAPABILITY ReadUserData WriteUserData ReadDeviceData WriteDeviceData + +OS_LAYER_SYSTEMINCLUDE + +LIBRARY MemSpyDriverClient.lib +LIBRARY MemSpyEngine.lib + +LIBRARY euser.lib +LIBRARY ecom.lib +LIBRARY efsrv.lib +LIBRARY estor.lib +LIBRARY bafl.lib +LIBRARY ws32.lib +LIBRARY cone.lib +LIBRARY eikcore.lib +LIBRARY fbscli.lib +LIBRARY PlatformEnv.lib +LIBRARY flogger.lib +LIBRARY apgrfx.lib +LIBRARY apparc.lib diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/MemSpyServer/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/memspy/MemSpyServer/group/bld.inf Fri May 14 17:25:03 2010 +0300 @@ -0,0 +1,22 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +PRJ_PLATFORMS +DEFAULT + +PRJ_MMPFILES +MemSpyServer.mmp diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/group/bld.inf --- a/memspy/group/bld.inf Mon May 03 13:58:41 2010 +0300 +++ b/memspy/group/bld.inf Fri May 14 17:25:03 2010 +0300 @@ -32,7 +32,12 @@ // Console UI #include "../Console/group/bld.inf" +// MemSpyServer +#include "../MemSpyServer/group/bld.inf" + +// MemSpyClient +#include "../MemSpyClient/group/bld.inf" PRJ_EXPORTS ../rom/memspy.iby CORE_IBY_EXPORT_PATH(tools,memspy.iby) -../rom/memspy_rom.iby CORE_IBY_EXPORT_PATH(tools/rom,memspy_rom.iby) +../rom/memspy_rom.iby CORE_IBY_EXPORT_PATH(tools/rom,memspy_rom.iby) \ No newline at end of file diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/memspy_plat/memspy_api/include/memspy/driver/shared/MemSpyDriverObjectsSharedRHeap.h --- a/memspy/memspy_plat/memspy_api/include/memspy/driver/shared/MemSpyDriverObjectsSharedRHeap.h Mon May 03 13:58:41 2010 +0300 +++ b/memspy/memspy_plat/memspy_api/include/memspy/driver/shared/MemSpyDriverObjectsSharedRHeap.h Fri May 14 17:25:03 2010 +0300 @@ -92,7 +92,7 @@ TInt iMinCell; TInt iPageSize; #ifdef __SYMBIAN_KERNEL_HYBRID_HEAP__ - struct SCell { TInt len; SCell* next }; + struct SCell { TInt len; SCell* next; }; SCell iFree; #else RHeap::SCell iFree; diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/memspy_plat/memspy_api/include/memspy/engine/Helpers/MemSpyEngineHelperHeap.h --- a/memspy/memspy_plat/memspy_api/include/memspy/engine/Helpers/MemSpyEngineHelperHeap.h Mon May 03 13:58:41 2010 +0300 +++ b/memspy/memspy_plat/memspy_api/include/memspy/engine/Helpers/MemSpyEngineHelperHeap.h Fri May 14 17:25:03 2010 +0300 @@ -26,6 +26,9 @@ // Driver includes #include +// MemSpyClient includes +#include + // Classes referenced class CMemSpyThread; class CMemSpyEngine; @@ -61,6 +64,8 @@ IMPORT_C void OutputHeapInfoForDeviceL( TBool aIncludeKernel = ETrue ); IMPORT_C CMemSpyEngineOutputList* NewHeapSummaryShortLC( const TMemSpyHeapInfo& aInfo ); IMPORT_C CMemSpyEngineOutputList* NewHeapSummaryExtendedLC( const TMemSpyHeapInfo& aInfo, const RArray* aFreeCells = NULL ); + //cigasto + IMPORT_C TMemSpyHeapData NewHeapRawInfo( const TMemSpyHeapInfo& aInfo ); //not formatted heap info public: // But not exported void OutputHeapDataKernelL( TBool aCreateDataStream ); diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/memspy_plat/memspy_api/include/memspy/engine/Helpers/MemSpyEngineHelperKernelContainers.h --- a/memspy/memspy_plat/memspy_api/include/memspy/engine/Helpers/MemSpyEngineHelperKernelContainers.h Mon May 03 13:58:41 2010 +0300 +++ b/memspy/memspy_plat/memspy_api/include/memspy/engine/Helpers/MemSpyEngineHelperKernelContainers.h Fri May 14 17:25:03 2010 +0300 @@ -87,6 +87,8 @@ IMPORT_C static TPtrC TypeAsString( TMemSpyDriverContainerType aType ); IMPORT_C TPtrC Name() const; IMPORT_C void OutputL( CMemSpyEngineOutputSink& aSink ) const; + IMPORT_C TInt Size() const; + IMPORT_C TInt ItemsCount() const; public: // But not exported TAny* HandleAt( TInt aIndex ) const; @@ -137,4 +139,5 @@ -#endif \ No newline at end of file +#endif + diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/memspy_plat/memspy_api/include/memspy/engine/ThreadAndProcess/MemSpyEngineObjectThread.h --- a/memspy/memspy_plat/memspy_api/include/memspy/engine/ThreadAndProcess/MemSpyEngineObjectThread.h Mon May 03 13:58:41 2010 +0300 +++ b/memspy/memspy_plat/memspy_api/include/memspy/engine/ThreadAndProcess/MemSpyEngineObjectThread.h Fri May 14 17:25:03 2010 +0300 @@ -56,6 +56,7 @@ IMPORT_C TBool IsSystemPermanent() const; IMPORT_C TBool IsSystemCritical() const; IMPORT_C TBool IsDead() const; + IMPORT_C TThreadPriority Priority() const; public: // API - misc IMPORT_C void KillL(); @@ -105,4 +106,4 @@ -#endif \ No newline at end of file +#endif diff -r ccab7f1f8266 -r 67c6ff54ec25 memspy/rom/memspy.iby --- a/memspy/rom/memspy.iby Mon May 03 13:58:41 2010 +0300 +++ b/memspy/rom/memspy.iby Fri May 14 17:25:03 2010 +0300 @@ -22,6 +22,10 @@ file=ABI_DIR\BUILD_DIR\MemSpyDriverClient.dll SHARED_LIB_DIR\MemSpyDriverClient.dll file=ABI_DIR\BUILD_DIR\MemSpyEngine.dll SHARED_LIB_DIR\MemSpyEngine.dll +// Client - server +file=ABI_DIR\BUILD_DIR\MemSpyServer.exe SHARED_LIB_DIR\MemSpyServer.exe +file=ABI_DIR\BUILD_DIR\MemSpyClient.dll SHARED_LIB_DIR\MemSpyClient.dll + // Commandline file=ABI_DIR\BUILD_DIR\MemSpy.exe SHARED_LIB_DIR\MemSpy.exe diff -r ccab7f1f8266 -r 67c6ff54ec25 stif/ATSInterface/src/ATSInterface.cpp --- a/stif/ATSInterface/src/ATSInterface.cpp Mon May 03 13:58:41 2010 +0300 +++ b/stif/ATSInterface/src/ATSInterface.cpp Fri May 14 17:25:03 2010 +0300 @@ -561,12 +561,12 @@ _LIT( KEngineIniFile, "-engineini" ); _LIT( KModuleIniFile, "-moduleini" ); - const TInt length = User().CommandLineLength(); + const TInt length = User::CommandLineLength(); HBufC* cmdLine = HBufC::NewLC( length ); TPtr ptr = cmdLine->Des(); - User().CommandLine( ptr ); + User::CommandLine( ptr ); TBool moduleFound( EFalse ); TLex lex( ptr ); diff -r ccab7f1f8266 -r 67c6ff54ec25 stif/StifTFwIf/src/UIEngineContainer.cpp --- a/stif/StifTFwIf/src/UIEngineContainer.cpp Mon May 03 13:58:41 2010 +0300 +++ b/stif/StifTFwIf/src/UIEngineContainer.cpp Fri May 14 17:25:03 2010 +0300 @@ -480,7 +480,6 @@ { // Call TestExecuted of CUIEngine interface iUIEngine->TestExecuted(this, iRunner->FullResult() ); - iState = EFinished; } } diff -r ccab7f1f8266 -r 67c6ff54ec25 stif/TestCombiner/inc/TestCombiner.h --- a/stif/TestCombiner/inc/TestCombiner.h Mon May 03 13:58:41 2010 +0300 +++ b/stif/TestCombiner/inc/TestCombiner.h Fri May 14 17:25:03 2010 +0300 @@ -655,6 +655,10 @@ RTimer iPauseTimer; TName iPausedTestCase; TInt iPauseTime; + + // Pause combiner timer + RTimer iPauseCombTimer; + TInt iPauseCombRemainingTime; // Temporary line buffer HBufC* iLine; diff -r ccab7f1f8266 -r 67c6ff54ec25 stif/TestCombiner/src/TestCombiner.cpp --- a/stif/TestCombiner/src/TestCombiner.cpp Mon May 03 13:58:41 2010 +0300 +++ b/stif/TestCombiner/src/TestCombiner.cpp Fri May 14 17:25:03 2010 +0300 @@ -2445,8 +2445,21 @@ */ void CTestRunner::ConstructL() { - - iPauseTimer.CreateLocal(); + TInt ret; + + ret = iPauseTimer.CreateLocal(); + if(ret != KErrNone) + { + __TRACE( KError, (_L("Unable to create RTimer: iPauseTimer [%d] "), ret)); + User::Leave(ret); + } + + ret = iPauseCombTimer.CreateLocal(); + if(ret != KErrNone) + { + __TRACE( KError, (_L("Unable to create RTimer: iPauseCombTimer [%d] "), ret)); + User::Leave(ret); + } iRemoteTimer = CRemoteTimer::NewL( iTestCombiner ); @@ -2515,6 +2528,8 @@ iLine = 0; iPauseTimer.Close(); + + iPauseCombTimer.Close(); } @@ -2550,8 +2565,34 @@ User::Leave( KErrGeneral ); } - TBool continueTask = EFalse; + TBool continueTask = EFalse; + + // Check if there is still some time for combiner pause and we need to + // continue pausing + if(iPauseCombRemainingTime > 0) + { + // Maximum time for one RTimer::After request + TInt maximumTime = KMaxTInt / 1000; + + __TRACE( KMessage, (_L("CTestRunner::RunL: Going to reissue PauseCombiner request ") ) ); + __TRACE( KMessage, (_L("CTestRunner::RunL: iRemainingTimeValue = %d"), iPauseCombRemainingTime ) ); + if( iPauseCombRemainingTime < maximumTime ) + { + iPauseCombTimer.After(iStatus, (iPauseCombRemainingTime * 1000)); + iPauseCombRemainingTime = 0; + } + else + { + iPauseCombRemainingTime -= maximumTime; + iPauseCombTimer.After(iStatus, (maximumTime * 1000)); + } + + SetActive(); + return; + } + + // Handling runner states switch( iState ) { case ERunnerWaitTimeout: @@ -2695,6 +2736,8 @@ __TRACE( KMessage, (_L("CTestRunner::DoCancel"))); iTestCombiner->TestModuleIf().Printf( KPrintPriLow, _L("Runner"), _L("DoCancel")); + iPauseCombTimer.Cancel(); + switch( iState ) { case ERunnerWaitTimeout: @@ -3397,7 +3440,7 @@ _LIT( KErrMsgPauseTimeoutNotDefined, "PauseCombiner : No timeout value given or value has invalid format" ); _LIT( KErrMsgPauseTimeoutNotPositive, "PauseCombiner : Timeout value can't be <0" ); - TBool continueTask = ETrue; + TBool continueTask = EFalse; TInt pauseTime; TInt ret = KErrNone; @@ -3416,12 +3459,31 @@ User::Leave( KErrArgument ); } - //Time given by End User should be given in miliseconds - pauseTime*=1000; - - __TRACE( KMessage, (_L("time=%d"), pauseTime ) ); - - User::After( pauseTime ); + + // Maximum time for one RTimer::After request + TInt maximumTime = KMaxTInt / 1000; + + // Check if pause value is suitable for RTimer::After + if(pauseTime < maximumTime) + { + iPauseCombTimer.After(iStatus, pauseTime * 1000); + iPauseCombRemainingTime = 0; + } + else + { + // Given pause value after multiplication with 1000 is + // larger than KMaxTInt, so we need to split it and + // re-request After with remaining value from RunL + + iPauseCombRemainingTime = pauseTime - maximumTime; + iPauseCombTimer.After(iStatus, maximumTime * 1000); + } + + SetActive(); + + __TRACE(KMessage, (_L("Executing pause, time=[%d]"), pauseTime)); + + iState = ERunnerRunning; return continueTask; } diff -r ccab7f1f8266 -r 67c6ff54ec25 stif/TestEngine/inc/TestEngine.h --- a/stif/TestEngine/inc/TestEngine.h Mon May 03 13:58:41 2010 +0300 +++ b/stif/TestEngine/inc/TestEngine.h Fri May 14 17:25:03 2010 +0300 @@ -59,20 +59,25 @@ }; // Struct to Test report settings -class TTestReportSettings +NONSHARABLE_CLASS(CTestReportSettings) + :public CBase { public: + + /** + * NewL is two-phased constructor. + */ + static CTestReportSettings* NewL(); - TTestReportSettings(){ iCreateTestReport = ETrue; - iPath = NULL; - iName = NULL; - iFormat = CStifLogger::ETxt; - iOutput = CStifLogger::EFile; - iOverwrite = ETrue; - iXML = EFalse; - } - ~TTestReportSettings(){ delete iPath; delete iName; } + ~CTestReportSettings(); + + private: + CTestReportSettings(); + /** + * By default Symbian OS constructor is private. + */ + void ConstructL(); public: @@ -231,7 +236,7 @@ public: // Data // Test report settings - TTestReportSettings iTestReportSettings; + CTestReportSettings* iTestReportSettings; // Logger overwrite settings TLoggerSettings iLoggerSettings; diff -r ccab7f1f8266 -r 67c6ff54ec25 stif/TestEngine/inc/TestReport.h --- a/stif/TestEngine/inc/TestReport.h Mon May 03 13:58:41 2010 +0300 +++ b/stif/TestEngine/inc/TestReport.h Fri May 14 17:25:03 2010 +0300 @@ -156,7 +156,7 @@ /** * Two-phased constructor. */ - static CTestReport* NewL( TTestReportSettings& aTestReportSettings, + static CTestReport* NewL( CTestReportSettings& aTestReportSettings, const TTestReportMode aReportMode ); /** @@ -199,7 +199,7 @@ /** * By default Symbian OS constructor is private. */ - void ConstructL( TTestReportSettings& aTestReportSettings ); + void ConstructL( CTestReportSettings& aTestReportSettings ); /** * Default C++ constructor. diff -r ccab7f1f8266 -r 67c6ff54ec25 stif/TestEngine/src/TestCaseController.cpp --- a/stif/TestEngine/src/TestCaseController.cpp Mon May 03 13:58:41 2010 +0300 +++ b/stif/TestEngine/src/TestCaseController.cpp Fri May 14 17:25:03 2010 +0300 @@ -2567,18 +2567,7 @@ __TRACE( KInit, ( _L("Loaded reset module[%S]"), &dllName ) ); } - // Verify the UID - TUid KUidTestModule = TUid::Uid ( 0x101FB3E7 ); - TUidType requiredUID( KDynamicLibraryUid, KSharedLibraryUid, KUidTestModule ); - - TUidType moduleUID = resetModule.Type(); - if ( moduleUID != requiredUID ) - { - // New instance can't be created - RDebug::Print( ( _L("STIF TF: Reset module has invalid UID. Aborting loading!") ) ); - __TRACE ( KError, ( CStifLogger::EError, _L("Reset module has invalid UID. Aborting loading!" ) ) ); - return KErrNotSupported; - } + // Get pointer to first exported function CTestInterfaceFactory libEntry; diff -r ccab7f1f8266 -r 67c6ff54ec25 stif/TestEngine/src/TestEngine.cpp --- a/stif/TestEngine/src/TestEngine.cpp Mon May 03 13:58:41 2010 +0300 +++ b/stif/TestEngine/src/TestEngine.cpp Fri May 14 17:25:03 2010 +0300 @@ -411,6 +411,8 @@ */ void CTestEngineServer::ConstructL() { + // Create report setting + iTestReportSettings = CTestReportSettings::NewL(); // Create container iContainerIndex = CObjectConIx::NewL(); @@ -505,6 +507,8 @@ __TRACE(KAlways, ( _L( "---------------- Log Ended ----------------" ) ) ); delete iLogger; + delete iTestReportSettings; + iTestReportSettings = NULL; } /* @@ -881,6 +885,7 @@ iTestCases = NULL; } + iTestCaseArray.Close(); delete iTestEngineSubSessions; iTestEngineSubSessions = NULL; @@ -1234,14 +1239,18 @@ void CTestEngine::InitTestReportAndLoggerVarL() { // Test report settings initialization - iTestEngineServer->iTestReportSettings.iCreateTestReport = ETrue; + iTestEngineServer->iTestReportSettings->iCreateTestReport = ETrue; _LIT( path, "C:\\LOGS\\TestFramework\\"); _LIT( name, "TestReport"); - iTestEngineServer->iTestReportSettings.iPath = path().AllocL(); - iTestEngineServer->iTestReportSettings.iName = name().AllocL(); - iTestEngineServer->iTestReportSettings.iFormat = CStifLogger::ETxt; - iTestEngineServer->iTestReportSettings.iOutput = CStifLogger::EFile; - iTestEngineServer->iTestReportSettings.iOverwrite = ETrue; + delete iTestEngineServer->iTestReportSettings->iPath; + iTestEngineServer->iTestReportSettings->iPath = NULL; + iTestEngineServer->iTestReportSettings->iPath = path().AllocL(); + delete iTestEngineServer->iTestReportSettings->iName; + iTestEngineServer->iTestReportSettings->iName = NULL; + iTestEngineServer->iTestReportSettings->iName = name().AllocL(); + iTestEngineServer->iTestReportSettings->iFormat = CStifLogger::ETxt; + iTestEngineServer->iTestReportSettings->iOutput = CStifLogger::EFile; + iTestEngineServer->iTestReportSettings->iOverwrite = ETrue; // Initializations to indicator is setting in use iTestEngineServer->iLoggerSettings.iIsDefined.iCreateLogDir = EFalse; @@ -1370,10 +1379,10 @@ Logger()->WriteDelimiter(); // Create Test Reporter if allowed - if ( iTestEngineServer->iTestReportSettings.iCreateTestReport ) + if ( iTestEngineServer->iTestReportSettings->iCreateTestReport ) { TRAPD(err, iTestReport = - CTestReport::NewL( iTestEngineServer->iTestReportSettings, + CTestReport::NewL( *(iTestEngineServer->iTestReportSettings), ( CTestReport::TTestReportMode ) iReportMode )); if(err!=KErrNone) { @@ -1476,7 +1485,7 @@ if ( get_ret == KErrNone ) { __TRACE( KInit,( _L( "Test report creation indicator: %d"), createTestReport ) ); - iTestEngineServer->iTestReportSettings.iCreateTestReport = createTestReport; + iTestEngineServer->iTestReportSettings->iCreateTestReport = createTestReport; } else { @@ -1484,7 +1493,7 @@ } // Get Test report path settings - if ( iTestEngineServer->iTestReportSettings.iCreateTestReport ) + if ( iTestEngineServer->iTestReportSettings->iCreateTestReport ) { __TRACE( KInit,( _L( "Parsing Test report path" ) ) ); TPtrC path; @@ -1494,9 +1503,9 @@ { __TRACE( KInit,( _L( "Test report path: %S"), &path ) ); // Delete old one before setting new one - delete iTestEngineServer->iTestReportSettings.iPath; - iTestEngineServer->iTestReportSettings.iPath = NULL; - iTestEngineServer->iTestReportSettings.iPath = path.AllocL(); + delete iTestEngineServer->iTestReportSettings->iPath; + iTestEngineServer->iTestReportSettings->iPath = NULL; + iTestEngineServer->iTestReportSettings->iPath = path.AllocL(); } else { @@ -1505,7 +1514,7 @@ } // Get Test report name settings - if ( iTestEngineServer->iTestReportSettings.iCreateTestReport ) + if ( iTestEngineServer->iTestReportSettings->iCreateTestReport ) { __TRACE( KInit,( _L( "Parsing Test report filename" ) ) ); TPtrC name; @@ -1515,9 +1524,9 @@ { __TRACE( KInit,( _L( "Test report filename: %S"), &name ) ); // Delete old one before setting new one - delete iTestEngineServer->iTestReportSettings.iName; - iTestEngineServer->iTestReportSettings.iName = NULL; - iTestEngineServer->iTestReportSettings.iName = name.AllocL(); + delete iTestEngineServer->iTestReportSettings->iName; + iTestEngineServer->iTestReportSettings->iName = NULL; + iTestEngineServer->iTestReportSettings->iName = name.AllocL(); } else { @@ -1526,7 +1535,7 @@ } // Get Test report format settings - if ( iTestEngineServer->iTestReportSettings.iCreateTestReport ) + if ( iTestEngineServer->iTestReportSettings->iCreateTestReport ) { __TRACE( KInit,( _L( "Parsing Test report format" ) ) ); CStifLogger::TLoggerType type; @@ -1536,8 +1545,8 @@ if ( get_ret == KErrNone ) { __TRACE( KInit,( _L( "Test report format: %d, xml: %d"), type, xml ) ); - iTestEngineServer->iTestReportSettings.iFormat = type; - iTestEngineServer->iTestReportSettings.iXML = xml; + iTestEngineServer->iTestReportSettings->iFormat = type; + iTestEngineServer->iTestReportSettings->iXML = xml; } else { @@ -1546,7 +1555,7 @@ } // Get Test report output settings - if ( iTestEngineServer->iTestReportSettings.iCreateTestReport ) + if ( iTestEngineServer->iTestReportSettings->iCreateTestReport ) { __TRACE( KInit,( _L( "Parsing Test report output" ) ) ); CStifLogger::TOutput output; @@ -1555,7 +1564,7 @@ if ( get_ret == KErrNone ) { __TRACE( KInit,( _L( "Test report output: %d"), output ) ); - iTestEngineServer->iTestReportSettings.iOutput = output; + iTestEngineServer->iTestReportSettings->iOutput = output; } else { @@ -1564,7 +1573,7 @@ } // Get Test report file creation mode (overwrite settings) - if ( iTestEngineServer->iTestReportSettings.iCreateTestReport ) + if ( iTestEngineServer->iTestReportSettings->iCreateTestReport ) { __TRACE( KInit,( _L( "Parsing Test report file writing mode" ) ) ); TBool overwrite; @@ -1573,7 +1582,7 @@ if ( get_ret == KErrNone ) { __TRACE( KInit,( _L( "Test report file creation mode: %d"), overwrite ) ); - iTestEngineServer->iTestReportSettings.iOverwrite = overwrite; + iTestEngineServer->iTestReportSettings->iOverwrite = overwrite; } else { @@ -5570,6 +5579,74 @@ DESCRIPTION + Default constructor + +------------------------------------------------------------------------------- +*/ +CTestReportSettings::CTestReportSettings() + { + iCreateTestReport = ETrue; + iPath = NULL; + iName = NULL; + iFormat = CStifLogger::ETxt; + iOutput = CStifLogger::EFile; + iOverwrite = ETrue; + iXML = EFalse; + } + +/* +------------------------------------------------------------------------------- + + DESCRIPTION + + Two-phased constructor. + +------------------------------------------------------------------------------- +*/ +CTestReportSettings* CTestReportSettings::NewL() + { + CTestReportSettings* self = new ( ELeave ) CTestReportSettings(); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + return self; + } + +/* +------------------------------------------------------------------------------- + + DESCRIPTION + + Symbian OS second phase constructor + +------------------------------------------------------------------------------- +*/ +void CTestReportSettings::ConstructL() + { + + } +/* +------------------------------------------------------------------------------- + + DESCRIPTION + + Destructor + +------------------------------------------------------------------------------- +*/ +CTestReportSettings::~CTestReportSettings() + { + delete iPath; + iPath = NULL; + delete iName; + iName = NULL; + } + +/* +------------------------------------------------------------------------------- + + DESCRIPTION + This module contains implementation of CRebootParams class member functions. ------------------------------------------------------------------------------- diff -r ccab7f1f8266 -r 67c6ff54ec25 stif/TestEngine/src/TestModuleController.cpp --- a/stif/TestEngine/src/TestModuleController.cpp Mon May 03 13:58:41 2010 +0300 +++ b/stif/TestEngine/src/TestModuleController.cpp Fri May 14 17:25:03 2010 +0300 @@ -250,6 +250,11 @@ if ( r != KErrNone ) { + if ( r == KErrBadName ) + { + __TRACE( KError, ( CStifLogger::ERed, _L( "Test Module name or Configuration File name is too long: [%S]" ), &name) ); + LeaveWithNotifyL( r, _L( "Test Module name or Configuration File name is too long." ) ); + } __TRACE( KError, ( CStifLogger::ERed, _L( "Can't connect to test module [%S], IniFile [%S]" ), &name, &aIniFile ) ); LeaveWithNotifyL( r, _L( "Can't connect to test module" ) ); } @@ -393,10 +398,11 @@ iTestCaseArray.Close(); // Release the config file array + iConfigFiles.ResetAndDestroy(); iConfigFiles.Close(); // Release the config file array - iFailedEnumerateConfig.Reset(); + iFailedEnumerateConfig.ResetAndDestroy(); iFailedEnumerateConfig.Close(); // Release the children array diff -r ccab7f1f8266 -r 67c6ff54ec25 stif/TestEngine/src/TestReport.cpp --- a/stif/TestEngine/src/TestReport.cpp Mon May 03 13:58:41 2010 +0300 +++ b/stif/TestEngine/src/TestReport.cpp Fri May 14 17:25:03 2010 +0300 @@ -194,7 +194,7 @@ ------------------------------------------------------------------------------- */ -void CTestReport::ConstructL( TTestReportSettings& aTestReportSettings ) +void CTestReport::ConstructL( CTestReportSettings& aTestReportSettings ) { // Create summary for all test cases _LIT( KName, "All test cases" ); @@ -248,28 +248,24 @@ { User::LeaveIfError( iFile.Replace( iFs, pathAndFile, - EFileWrite | EFileStreamText | EFileShareAny ) ); + EFileWrite | EFileStreamText | EFileShareExclusive ) ); } else { - TBool isOpen( EFalse ); - TInt fileOpen = iFs.IsFileOpen( pathAndFile, isOpen ); + TInt fileOpen = iFile.Open( iFs, + pathAndFile, + EFileWrite | EFileStreamText | EFileShareAny ); if( fileOpen == KErrNotFound ) { User::LeaveIfError( iFile.Create( iFs, pathAndFile, - EFileWrite | EFileStreamText | EFileShareAny ) ); + EFileWrite | EFileStreamText | EFileShareExclusive ) ); } else if( fileOpen == KErrNone ) { - User::LeaveIfError( - iFile.Open( iFs, - pathAndFile, - EFileWrite | EFileStreamText | EFileShareAny ) ); TInt endPosOfFile = 0; User::LeaveIfError( iFile.Seek( ESeekEnd, endPosOfFile ) ); - } else { @@ -307,7 +303,7 @@ ------------------------------------------------------------------------------- */ -CTestReport* CTestReport::NewL( TTestReportSettings& aTestReportSettings, +CTestReport* CTestReport::NewL( CTestReportSettings& aTestReportSettings, const TTestReportMode aReportMode ) { CTestReport* self = new ( ELeave ) CTestReport( aReportMode ); @@ -339,6 +335,9 @@ */ CTestReport::~CTestReport() { + iTestModulesVersionsInfo.ResetAndDestroy(); + iTestModulesVersionsInfo.Close(); + // Reset and destroy arrays iTestSummaries.ResetAndDestroy(); delete iTotalSummary; diff -r ccab7f1f8266 -r 67c6ff54ec25 stif/TestInterface/src/TestInterface.cpp --- a/stif/TestInterface/src/TestInterface.cpp Mon May 03 13:58:41 2010 +0300 +++ b/stif/TestInterface/src/TestInterface.cpp Fri May 14 17:25:03 2010 +0300 @@ -418,7 +418,7 @@ //__UHEAP_MARK; // Get module name from command line - const TInt length = User().CommandLineLength(); + const TInt length = User::CommandLineLength(); HBufC* cmdLine = HBufC::New( length ); if ( cmdLine == NULL ) @@ -428,7 +428,7 @@ } TPtr moduleName = cmdLine->Des(); - User().CommandLine( moduleName ); + User::CommandLine( moduleName ); RDebug::Print(_L("StartSession() Received data [%S]"), &moduleName); diff -r ccab7f1f8266 -r 67c6ff54ec25 stif/TestModuleTemplates/TestModuleTemplates.zip Binary file stif/TestModuleTemplates/TestModuleTemplates.zip has changed diff -r ccab7f1f8266 -r 67c6ff54ec25 stif/TestServer/inc/TestServer.h --- a/stif/TestServer/inc/TestServer.h Mon May 03 13:58:41 2010 +0300 +++ b/stif/TestServer/inc/TestServer.h Fri May 14 17:25:03 2010 +0300 @@ -703,7 +703,64 @@ }; +// DESCRIPTION +// CTestCasesList is a class, which contains list of test cases assosiated with +// specified config file. +NONSHARABLE_CLASS( CTestCasesList ): public CBase + { +public: + /** + * NewL is first phase of two-phased constructor. + */ + static CTestCasesList* NewL( const TDesC& aConfigFileName ); +public: + /** + * Destructor of CTestServer. + */ + ~CTestCasesList(); + /** + * Appends test case. + */ + void AppendTestCaseL( const TDesC& aTestCaseTitle ); + + /** + * Returns specified test case title. + */ + const TDesC& GetTestCaseTitleL( TInt aIndex ) const; + + /** + * Returns config file name. + */ + const TDesC& GetConfigFileName() const; + + /** + * Returns count of test cases. + */ + TInt Count() const; + + /** + * Resets list of test cases. + */ + void ResetAndDestroy(); +private: + /** + * C++ default constructor. + */ + CTestCasesList(); + + /** + * By default Symbian OS constructor is private. + */ + void ConstructL( const TDesC& aConfigFileName ); +private: + // Config file name + HBufC* iConfigFileName; + // List of test cases + RPointerArray iTestCases; + }; + + // DESCRIPTION // CTestModule is a session class. // Session for the CTestServer server, to a single client-side session @@ -844,7 +901,7 @@ /** * Get title of currently running test case */ - void GetTestCaseTitleL(TInt aTestCaseNumber, TDes& aTestCaseTitle); + void GetTestCaseTitleL(TInt aTestCaseNumber, const TDesC& aConfigFile, TDes& aTestCaseTitle); /** * Get pointer to test server @@ -901,7 +958,7 @@ TBool iErrorMessageAvailable; // Error message available? - RPointerArray iTestCaseTitles; //Test case titles + RPointerArray iTestCaseTitlesMap; //Test case titles public: // Friend classes // None diff -r ccab7f1f8266 -r 67c6ff54ec25 stif/TestServer/src/TestExecutionThread.cpp --- a/stif/TestServer/src/TestExecutionThread.cpp Mon May 03 13:58:41 2010 +0300 +++ b/stif/TestServer/src/TestExecutionThread.cpp Fri May 14 17:25:03 2010 +0300 @@ -272,22 +272,7 @@ __TRACEI (KInit, ( _L("Loaded test module[%S]"), &moduleName ) ); } - // Verify the UID - TUid KUidTestModule = TUid::Uid ( 0x101FB3E7 ); - TUidType requiredUID( KDynamicLibraryUid, KSharedLibraryUid, KUidTestModule ); - - TUidType moduleUID = aModule.Type(); - if ( moduleUID != requiredUID ) - { - // New instance can't be created - RDebug::Print( ( _L("STIF TF: Test module has invalid UID. Aborting loading!") ) ); - __TRACEI (KError, ( CStifLogger::EError, _L("Test module has invalid UID. Aborting loading!"))); - tmpBuffer.Format(_L("Module [%S] has invalid UID"), &moduleName); - ErrorPrint( 1, tmpBuffer ); - ModuleContainer().OperationErrorResult() = KErrNotSupported; - return KErrNotSupported; - } - + // Get pointer to first exported function ModuleContainer().OperationText() = _L("1st EXPORTED function"); CTestInterfaceFactory libEntry; diff -r ccab7f1f8266 -r 67c6ff54ec25 stif/TestServer/src/TestModuleContainer.cpp --- a/stif/TestServer/src/TestModuleContainer.cpp Mon May 03 13:58:41 2010 +0300 +++ b/stif/TestServer/src/TestModuleContainer.cpp Fri May 14 17:25:03 2010 +0300 @@ -1747,19 +1747,7 @@ __TRACE( KInit, ( _L("Loaded test module[%S]"), &dllName ) ); } - // Verify the UID - TUid KUidTestModule = TUid::Uid ( 0x101FB3E7 ); - TUidType requiredUID( KDynamicLibraryUid, KSharedLibraryUid, KUidTestModule ); - - TUidType moduleUID = testModule.Type(); - if ( moduleUID != requiredUID ) - { - // New instance can't be created - RDebug::Print( ( _L("STIF TF: Test module has invalid UID. Aborting loading!") ) ); - __TRACE ( KError, ( CStifLogger::EError, _L("Test module has invalid UID. Aborting loading!" ) ) ); - testModule.Close(); - return KErrNotSupported; - } + CTestInterfaceFactoryTestModule libEntry = NULL; @@ -1973,7 +1961,10 @@ */ void CTestModuleContainer::GetTestCaseTitleL(TDes& aTestCaseTitle) { - iCTestModule->GetTestCaseTitleL(iOperationIntBuffer, aTestCaseTitle); //currently run test case stored in the iOperationIntBuffer variable + //currently run test case stored in the iOperationIntBuffer variable + iCTestModule->GetTestCaseTitleL( iOperationIntBuffer, + iCTestExecution->GetConfigFileName(), + aTestCaseTitle); } diff -r ccab7f1f8266 -r 67c6ff54ec25 stif/TestServer/src/TestServerClient.cpp --- a/stif/TestServer/src/TestServerClient.cpp Mon May 03 13:58:41 2010 +0300 +++ b/stif/TestServer/src/TestServerClient.cpp Fri May 14 17:25:03 2010 +0300 @@ -120,6 +120,15 @@ do { semName.Format(_L("%S%d"), &semaphoreName, x); + if (semName.Length() > KMaxKernelName) + { + // if the cfg file name is larger than maximum length of acceptable length of semaphore . + RDebug::Print(_L("Test Module name or Configuration File name is too long.")); + + semName.Close(); + return KErrBadName; + } + ret = startSemaphore.CreateGlobal(semName, 0); RDebug::Print(_L("RTestServer::Connect() Creating global semaphore [%S] with result [%d]"), &semName, ret); if(ret != KErrAlreadyExists) @@ -153,7 +162,7 @@ // Data to be passed to new process. It will contain module name and synchronization semaphore name separated with space. // I.e. it will be: "mymodule startupSemaphore0" RBuf data; - ret = data.Create(KMaxName); + ret = data.Create(KMaxFileName); if(ret != KErrNone) { RDebug::Print(_L("RTestServer::Connect() Could not create buffer for data to be passed to process [%d]"), ret); diff -r ccab7f1f8266 -r 67c6ff54ec25 stif/TestServer/src/Testserversession.cpp --- a/stif/TestServer/src/Testserversession.cpp Mon May 03 13:58:41 2010 +0300 +++ b/stif/TestServer/src/Testserversession.cpp Fri May 14 17:25:03 2010 +0300 @@ -55,6 +55,234 @@ // ================= MEMBER FUNCTIONS ========================================= +/* +------------------------------------------------------------------------------- + + Class: CTestCasesList + + Method: NewL + + Description: Create new test cases list + + Parameters: const TDesC& aConfigFileName :in: Config file name + + Return Values: CTestCasesList* Pointer to new test cases list + + Errors/Exceptions: Leaves if memory allocation fails or ConstructL leaves. + + Status: Approved + +------------------------------------------------------------------------------- +*/ +CTestCasesList* CTestCasesList::NewL( const TDesC& aConfigFileName ) + { + CTestCasesList* self = new(ELeave)CTestCasesList; + CleanupStack::PushL( self ); + self->ConstructL( aConfigFileName ); + CleanupStack::Pop( self ); + return self; + } + +/* +------------------------------------------------------------------------------- + + Class: CTestCasesList + + Method: ~CTestCasesList + + Description: Destructor + + Parameters: + + Return Values: + + Errors/Exceptions: + + Status: Approved + +------------------------------------------------------------------------------- +*/ +CTestCasesList::~CTestCasesList() + { + delete iConfigFileName; + iConfigFileName = NULL; + iTestCases.ResetAndDestroy(); + iTestCases.Close(); + } + +/* +------------------------------------------------------------------------------- + + Class: CTestCasesList + + Method: AppendTestCaseL + + Description: Appends test case. + + Parameters: const TDesC& aTestCaseTitle in: Test case title + + Return Values: + + Errors/Exceptions: Leaves if memory allocation fails + + Status: Approved + +------------------------------------------------------------------------------- +*/ +void CTestCasesList::AppendTestCaseL( const TDesC& aTestCaseTitle ) + { + HBufC* testCaseTitle = aTestCaseTitle.AllocL(); + CleanupStack::PushL( testCaseTitle ); + iTestCases.AppendL( testCaseTitle ); + CleanupStack::Pop( testCaseTitle ); + } + +/* +------------------------------------------------------------------------------- + + Class: CTestCasesList + + Method: GetTestCaseTitleL + + Description: Returns specified test case title + + Parameters: TInt aIndex: in: Requested test case index. + + Return Values: Test case title. + + Errors/Exceptions: Leaves if test case index is invalid + + Status: Approved + +------------------------------------------------------------------------------- +*/ +const TDesC& CTestCasesList::GetTestCaseTitleL( TInt aIndex ) const + { + if ( ( aIndex < 0 ) || ( aIndex >= iTestCases.Count() ) ) + { + User::Leave( KErrNotFound ); + } + return *iTestCases[ aIndex ]; + } + +/* +------------------------------------------------------------------------------- + + Class: CTestCasesList + + Method: GetConfigFileName + + Description: Returns config file name + + Parameters: + + Return Values: Config file name. + + Errors/Exceptions: + + Status: Approved + +------------------------------------------------------------------------------- +*/ +const TDesC& CTestCasesList::GetConfigFileName() const + { + return *iConfigFileName; + } + +/* +------------------------------------------------------------------------------- + + Class: CTestCasesList + + Method: Count + + Description: Returns count of test cases. + + Parameters: + + Return Values: Test cases count. + + Errors/Exceptions: + + Status: Approved + +------------------------------------------------------------------------------- +*/ +TInt CTestCasesList::Count() const + { + return iTestCases.Count(); + } + +/* +------------------------------------------------------------------------------- + + Class: CTestCasesList + + Method: ResetAndDestroy + + Description: Resets list of test cases. + + Parameters: + + Return Values: + + Errors/Exceptions: + + Status: Approved + +------------------------------------------------------------------------------- +*/ +void CTestCasesList::ResetAndDestroy() + { + iTestCases.ResetAndDestroy(); + } + +/* +------------------------------------------------------------------------------- + + Class: CTestCasesList + + Method: ~CTestCasesList + + Description: Destructor + + Parameters: + + Return Values: + + Errors/Exceptions: + + Status: Approved + +------------------------------------------------------------------------------- +*/ +CTestCasesList::CTestCasesList() + { + } + +/* +------------------------------------------------------------------------------- + + Class: CTestCasesList + + Method: ~CTestCasesList + + Description: Destructor + + Parameters: + + Return Values: + + Errors/Exceptions: + + Status: Approved + +------------------------------------------------------------------------------- +*/ +void CTestCasesList::ConstructL( const TDesC& aConfigFileName ) + { + iConfigFileName = aConfigFileName.AllocL(); + } /* ------------------------------------------------------------------------------- @@ -188,8 +416,8 @@ iIniBuffer = NULL; // Delete array of test case titles - iTestCaseTitles.ResetAndDestroy(); - iTestCaseTitles.Close(); + iTestCaseTitlesMap.ResetAndDestroy(); + iTestCaseTitlesMap.Close(); } /* @@ -690,18 +918,34 @@ User::Leave( KErrGeneral ); } + CTestCasesList* testCasesList = NULL; + for ( TInt i = 0; i < iTestCaseTitlesMap.Count(); i++ ) + { + if ( iTestCaseTitlesMap[ i ]->GetConfigFileName() == config ) + { + testCasesList = iTestCaseTitlesMap[ i ]; + break; + } + } + if ( testCasesList == NULL ) + { + testCasesList = CTestCasesList::NewL( config ); + CleanupStack::PushL( testCasesList ); + iTestCaseTitlesMap.AppendL( testCasesList ); + CleanupStack::Pop( testCasesList ); + } + // Store titles (for further use, i.e. when asked for title from the interface via CTestModuleIf->CTestThreadContainer->CTestModuleContainer) - iTestCaseTitles.ResetAndDestroy(); + testCasesList->ResetAndDestroy(); TInt i; for(i = 0; i < testCases->Count(); i++) { //Handle situation when test cases are enumerated not as 0-based (testscripter, ...) if(i == 0 && (*testCases)[i]->iCaseNumber > 0) { - iTestCaseTitles.Append(NULL); + testCasesList->AppendTestCaseL( KNullDesC ); } - HBufC* title = (*testCases)[i]->iTitle.AllocL(); - iTestCaseTitles.Append(title); + testCasesList->AppendTestCaseL( (*testCases)[i]->iTitle ); } TPckgBuf countPckg( testCases->Count() ); @@ -1380,10 +1624,25 @@ ------------------------------------------------------------------------------- */ -void CTestModule::GetTestCaseTitleL(TInt aTestCaseNumber, TDes& aTestCaseTitle) +void CTestModule::GetTestCaseTitleL(TInt aTestCaseNumber, const TDesC& aConfigFile,TDes& aTestCaseTitle) { - RDebug::Print(_L("Trying to get test case title from module. Index=%d, count=%d"), aTestCaseNumber, iTestCaseTitles.Count()); - aTestCaseTitle.Copy(*(iTestCaseTitles[aTestCaseNumber])); + CTestCasesList* testCasesList = NULL; + for ( TInt i = 0; i < iTestCaseTitlesMap.Count(); i++ ) + { + if ( iTestCaseTitlesMap[ i ]->GetConfigFileName() == aConfigFile ) + { + testCasesList = iTestCaseTitlesMap[ i ]; + break; + } + } + if ( testCasesList == NULL ) + { + User::Leave( KErrNotFound ); + } + + RDebug::Print(_L("Trying to get test case title from module. Index=%d, count=%d"), aTestCaseNumber, testCasesList->Count() ); + + aTestCaseTitle.Copy( testCasesList->GetTestCaseTitleL( aTestCaseNumber ) ); } diff -r ccab7f1f8266 -r 67c6ff54ec25 stif/TestServerStarter/src/TestServerStarter.cpp --- a/stif/TestServerStarter/src/TestServerStarter.cpp Mon May 03 13:58:41 2010 +0300 +++ b/stif/TestServerStarter/src/TestServerStarter.cpp Fri May 14 17:25:03 2010 +0300 @@ -53,7 +53,7 @@ RDebug::Print(_L("STIF: New process starting")); // Get module name from command line - const TInt length = User().CommandLineLength(); + const TInt length = User::CommandLineLength(); HBufC* cmdLine = HBufC::New( length ); @@ -64,7 +64,7 @@ TPtr moduleName = cmdLine->Des(); - User().CommandLine( moduleName ); + User::CommandLine( moduleName ); RDebug::Print(_L("STIF: Received data [%S]"), &moduleName); diff -r ccab7f1f8266 -r 67c6ff54ec25 stif/group/ReleaseNote.txt --- a/stif/group/ReleaseNote.txt Mon May 03 13:58:41 2010 +0300 +++ b/stif/group/ReleaseNote.txt Fri May 14 17:25:03 2010 +0300 @@ -1,5 +1,5 @@ ======================================================================== -RELEASE NOTE FOR STIF - STIF_201012 (7.3.29) +RELEASE NOTE FOR STIF - STIF_201016 (7.3.31) SUPPORTING SERIES 60 3.0 -> ======================================================================== diff -r ccab7f1f8266 -r 67c6ff54ec25 stif/inc/TestServerModuleIf.h --- a/stif/inc/TestServerModuleIf.h Mon May 03 13:58:41 2010 +0300 +++ b/stif/inc/TestServerModuleIf.h Fri May 14 17:25:03 2010 +0300 @@ -470,6 +470,7 @@ */ TInt TestThreadMutexHandle() { return iTestThreadMutex.Handle(); }; + const TDesC& GetConfigFileName() const { return iConfig; } public: // Functions from base classes // None diff -r ccab7f1f8266 -r 67c6ff54ec25 stif/inc/version.h --- a/stif/inc/version.h Mon May 03 13:58:41 2010 +0300 +++ b/stif/inc/version.h Fri May 14 17:25:03 2010 +0300 @@ -20,9 +20,9 @@ #define STIF_MAJOR_VERSION 7 #define STIF_MINOR_VERSION 3 -#define STIF_BUILD_VERSION 29 +#define STIF_BUILD_VERSION 31 -#define STIF_REL_DATE "23th Mar 2010" +#define STIF_REL_DATE "19th Apr 2010" #define TO_UNICODE(text) _L(text) diff -r ccab7f1f8266 -r 67c6ff54ec25 stif/sis/Stif_31.sis Binary file stif/sis/Stif_31.sis has changed