Revision: 201018
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 03 May 2010 13:58:41 +0300
changeset 15 ccab7f1f8266
parent 13 33016869e0dd
child 17 67c6ff54ec25
child 20 a71a3e32a2ae
Revision: 201018 Kit: 201018
memspy/Driver/Kernel/Include/MemSpyDriverHeap.h
memspy/Driver/Kernel/Source/MemSpyDriverHeap.cpp
memspy/Driver/Kernel/Source/SubChannels/MemSpyDriverLogChanHeapBase.cpp
memspy/Driver/User/Include/RBuildQueryableHeap.h
memspy/Driver/group/MemSpyDriver.mmp
memspy/memspy_plat/memspy_api/include/memspy/driver/shared/MemSpyDriverObjectsShared.h
memspy/memspy_plat/memspy_api/include/memspy/driver/shared/MemSpyDriverObjectsSharedRHeap.h
memspy/memspy_plat/memspy_api/include/memspy/engine/Helpers/MemSpyEngineHelperCodeSegment.h
stif/ConsoleUI/inc/ConsoleMenus.h
stif/ConsoleUI/src/Consolemenus.cpp
stif/TestServer/src/Testserversession.cpp
stif/TouchConsoleUI/src/Consolemenus.cpp
stif/group/ReleaseNote.txt
stif/inc/version.h
stif/sis/Stif_31.sis
--- a/memspy/Driver/Kernel/Include/MemSpyDriverHeap.h	Fri Apr 16 16:37:27 2010 +0300
+++ b/memspy/Driver/Kernel/Include/MemSpyDriverHeap.h	Mon May 03 13:58:41 2010 +0300
@@ -228,6 +228,7 @@
     /**
      * Used when opening the kernel heap
      */
+#ifndef __SYMBIAN_KERNEL_HYBRID_HEAP__
     class RHeapKExtended : public RHeapK
         {
     public:
@@ -243,7 +244,7 @@
         inline void ResetFailed() { iFailed = EFalse; }
         inline void ResetFailAllocCount() { iFailAllocCount = 0; }
         };
-
+#endif
 private:
     RHeapK* iKernelHeap;
     DChunk* iChunk;
--- a/memspy/Driver/Kernel/Source/MemSpyDriverHeap.cpp	Fri Apr 16 16:37:27 2010 +0300
+++ b/memspy/Driver/Kernel/Source/MemSpyDriverHeap.cpp	Mon May 03 13:58:41 2010 +0300
@@ -511,8 +511,10 @@
 
 void RMemSpyDriverRHeapKernelInPlace::FailNext()
     {
+#ifndef __SYMBIAN_KERNEL_HYBRID_HEAP__
     RMemSpyDriverRHeapKernelInPlace::RHeapKExtended* heap = reinterpret_cast< RMemSpyDriverRHeapKernelInPlace::RHeapKExtended* >( iKernelHeap );
     heap->FailNext();
+#endif
     }
 
 
--- a/memspy/Driver/Kernel/Source/SubChannels/MemSpyDriverLogChanHeapBase.cpp	Fri Apr 16 16:37:27 2010 +0300
+++ b/memspy/Driver/Kernel/Source/SubChannels/MemSpyDriverLogChanHeapBase.cpp	Mon May 03 13:58:41 2010 +0300
@@ -967,7 +967,12 @@
     TRACE_KH( Kern::Printf("DMemSpyDriverLogChanHeapBase::OpenKernelHeap(CP) - open err: %d", r ) );
     if  ( r == KErrNone )
         {
+#ifdef __SYMBIAN_KERNEL_HYBRID_HEAP__
+		// RAllocator::Size() not exported on hybrid heap
+		const TInt heapSize = heap->DebugFunction(RAllocator::EGetSize);
+#else
         const TInt heapSize = heap->Size();
+#endif
         TRACE_KH( Kern::Printf("DMemSpyDriverLogChanHeapBase::OpenKernelHeap(CP) - heapSize: %d, heap: 0x%08x, chunkBase: 0x%08x", heapSize, heap, chunk->Base() ) );
 
         // Make a new chunk that we can copy the kernel heap into. We cannot lock the system the entire time
@@ -1010,7 +1015,7 @@
                 TRACE_KH( Kern::Printf("DMemSpyDriverLogChanHeapBase::OpenKernelHeap(CP) - heapCopyChunk->iSize: 0x%08x, heapCopyChunk->iBase: 0x%08x, heapCopyChunkAddress: 0x%08x, physicalAddress: 0x%08x", heapCopyChunk->iSize, heapCopyChunk->iBase, heapCopyChunkAddress, physicalAddress));
 
                 NKern::LockSystem();
-                const TUint32 copyLength = Min( heap->Size(), heapSize );
+                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() ));
                 memcpy( (TUint8*) heapCopyChunkAddress, heap, copyLength );
--- a/memspy/Driver/User/Include/RBuildQueryableHeap.h	Fri Apr 16 16:37:27 2010 +0300
+++ b/memspy/Driver/User/Include/RBuildQueryableHeap.h	Mon May 03 13:58:41 2010 +0300
@@ -30,13 +30,6 @@
 public: // API
     TBool IsDebugEUser() const;
     TInt CellHeaderSize( TMemSpyDriverCellType aType ) const;
-
-public: // Exposure of RHeap protected data members
-    inline TInt MinCellSize() const
-        {
-        return iMinCell;
-        }
-
     };
 
 
--- a/memspy/Driver/group/MemSpyDriver.mmp	Fri Apr 16 16:37:27 2010 +0300
+++ b/memspy/Driver/group/MemSpyDriver.mmp	Mon May 03 13:58:41 2010 +0300
@@ -83,5 +83,4 @@
     MACRO       MCL_DOBJECTIX_DUPLICATION
 #endif
 
-
 #include <kernel/kern_ext.mmh>
--- a/memspy/memspy_plat/memspy_api/include/memspy/driver/shared/MemSpyDriverObjectsShared.h	Fri Apr 16 16:37:27 2010 +0300
+++ b/memspy/memspy_plat/memspy_api/include/memspy/driver/shared/MemSpyDriverObjectsShared.h	Mon May 03 13:58:41 2010 +0300
@@ -19,10 +19,7 @@
 #define MEMSPYDRIVEROBJECTSSHARED_H
 
 // System includes
-#include <e32cmn.h>
-#include <e32ldr.h>
-#include <e32ldr_private.h>
-#include <e32property.h>
+#include <u32std.h>
 
 // User includes
 #include <memspy/driver/memspydriverenumerationsshared.h>
--- a/memspy/memspy_plat/memspy_api/include/memspy/driver/shared/MemSpyDriverObjectsSharedRHeap.h	Fri Apr 16 16:37:27 2010 +0300
+++ b/memspy/memspy_plat/memspy_api/include/memspy/driver/shared/MemSpyDriverObjectsSharedRHeap.h	Mon May 03 13:58:41 2010 +0300
@@ -19,9 +19,7 @@
 #define MEMSPYDRIVEROBJECTSSHAREDRHEAP_H
 
 // System includes
-#include <e32cmn.h>
-#include <e32ldr.h>
-#include <e32ldr_private.h>
+#include <u32std.h>
 #ifndef __KERNEL_MODE__
 #include <e32debug.h>
 #endif
@@ -93,7 +91,12 @@
 	TInt iAlign;
 	TInt iMinCell;
 	TInt iPageSize;
+#ifdef __SYMBIAN_KERNEL_HYBRID_HEAP__
+	struct SCell { TInt len; SCell* next };
+    SCell iFree;
+#else
     RHeap::SCell iFree;
+#endif
 	TInt iNestingLevel;
 	TInt iAllocCount;
     RAllocator::TAllocFail iFailType;
--- a/memspy/memspy_plat/memspy_api/include/memspy/engine/Helpers/MemSpyEngineHelperCodeSegment.h	Fri Apr 16 16:37:27 2010 +0300
+++ b/memspy/memspy_plat/memspy_api/include/memspy/engine/Helpers/MemSpyEngineHelperCodeSegment.h	Mon May 03 13:58:41 2010 +0300
@@ -20,8 +20,7 @@
 
 // System includes
 #include <e32base.h>
-#include <e32ldr.h>
-#include <e32ldr_private.h>
+#include <e32svr.h>
 #include <badesca.h>
 
 // User includes
@@ -144,4 +143,4 @@
 
 
 
-#endif
\ No newline at end of file
+#endif
--- a/stif/ConsoleUI/inc/ConsoleMenus.h	Fri Apr 16 16:37:27 2010 +0300
+++ b/stif/ConsoleUI/inc/ConsoleMenus.h	Mon May 03 13:58:41 2010 +0300
@@ -163,6 +163,12 @@
     protected:  // New functions
         // None
 
+    private:   // New functions
+        /**
+        * Changes internal variables to move cursor in the menu.
+        */
+        void MovePosition(TInt aDelta);
+
     protected:  // Functions from base classes
         // None    
 
@@ -217,7 +223,7 @@
 		TUpdateType             iUpdateType;
 		
     private:    // Data
-        // None
+        TName           iScrolledLine; //Original value of line, that was recently scrolled
 
     public:     // Friend classes
         // None
--- a/stif/ConsoleUI/src/Consolemenus.cpp	Fri Apr 16 16:37:27 2010 +0300
+++ b/stif/ConsoleUI/src/Consolemenus.cpp	Mon May 03 13:58:41 2010 +0300
@@ -218,7 +218,7 @@
 */
 void CMenu::TimerUpdate()
     {    
-
+    iScrolledLine.Zero();
     RRefArray<TDesC> texts;
     User::LeaveIfError( ItemTexts( texts ) );
     
@@ -244,7 +244,7 @@
 
     // If menu item have not been changed after last timer, then
     // start scrolling  
-    const TDesC& name = texts[ iFirst + iPosOnScreen ]; 
+    const TDesC& name = texts[ iFirst + iPosOnScreen ];
     if ( name.Length() > ( iSize.iWidth - KMenuOverhead ) )
         {
 
@@ -255,7 +255,7 @@
         iStart = iStart + iDirection;
 
         // "Right end"
-        if ( iStart + iSize.iWidth > name.Length() + KMenuOverhead )
+        if ( iStart + iSize.iWidth > name.Length() + KMenuOverhead + 2)
             {
             iStart--;
             iDirection = -1;
@@ -277,7 +277,8 @@
         LimitedAppend( iTmp, name.Mid ( iStart ) );
             
         iConsole->SetPos( 0, iPosOnScreen+1);       
-        iConsole->Printf ( iTmp.Left( iSize.iWidth -2 )  );
+        Print(iTmp);
+        iScrolledLine.Copy(texts[iFirst + iPosOnScreen].Left(iScrolledLine.MaxLength())); 
 
         iConsole->SetPos(x,y);
         }
@@ -395,10 +396,14 @@
         {
         //removing "*" sign from the previous cursor position
         iConsole->SetPos(0, iPrevPosOnScreen + iMenuItemsListStartIndex);
-        line.Append( _L("  ") );
-        iConsole->Printf(line);
+        //line.Append( _L("  ") );
+        AppendBefore(iPrevPosOnScreen + iFirst, line);
+        LimitedAppend(line, iScrolledLine);
+        //iConsole->Printf(line);
+        Print(line);
         iConsole->SetPos(0, iPosOnScreen + iMenuItemsListStartIndex);
         line.Zero();
+        iScrolledLine.Zero();
         
         //writing "*" sign before the currently selected line
         line.Append( _L(" *") );
@@ -408,7 +413,67 @@
         }
     }
 
-
+/*
+-------------------------------------------------------------------------------
+
+    Class: CMenu
+
+    Method: SelectL
+
+    Description: Common method to count all variables needed for printing
+                 page of the screen.
+
+    Parameters: TInt aDelta       :in:      where to move current position
+                 Value > 0 stands for moving down the menu.
+                 Value < 0 stands for moving up the menu.
+
+    Return Values: 
+
+    Errors/Exceptions: None
+
+    Status: Draft
+
+-------------------------------------------------------------------------------
+*/
+void CMenu::MovePosition(TInt aDelta)
+    {
+    if(iItemCount > 0 && aDelta != 0)
+        {
+        // Valid screen size
+        TInt screenSize = iScreenSize + 1;
+        TInt realPosition = iFirst + iPosOnScreen;
+
+        // Number of all pages and items in the last page
+        TInt rest = iItemCount % screenSize;
+        TInt pages = (iItemCount / screenSize) + ((rest == 0) ? (0) : (1));
+
+        // Current page
+        TInt currPage = realPosition / screenSize;
+        
+        // New page
+        TInt newRealPosition = realPosition + aDelta;
+        while(newRealPosition < 0)
+            newRealPosition += iItemCount;
+        newRealPosition %= iItemCount;
+        TInt newPage = newRealPosition / screenSize;
+        
+        // Change position
+        iFirst = newPage * screenSize;
+        iLast = iFirst + screenSize - 1;
+        if(iLast >= iItemCount)
+            iLast = iItemCount - 1;
+        iPrevPosOnScreen = iPosOnScreen;
+        iPosOnScreen = newRealPosition % screenSize;
+        if(newPage == pages - 1 && iPosOnScreen >= rest)
+            iPosOnScreen = rest - 1;
+            
+        // Prevent refreshing
+        iPreventClearScreen = (currPage == newPage);
+        }
+    else
+        iPreventClearScreen = ETrue;    
+    }
+    
 /*
 -------------------------------------------------------------------------------
 
@@ -442,6 +507,7 @@
     case EKeyEscape:
         aContinue = EFalse;
         return this;
+
     // SelectL item
     case EKeyEnter:
     case EKeyRightArrow:
@@ -453,139 +519,33 @@
 
     // Go down
     case EKeyDownArrow:
-        {
-        if ( iFirst + iPosOnScreen == iItemCount - 1 )
-            {
-            // If end of the list, go to beginning
-            iPosOnScreen = 0;
-            iFirst = 0;
-            iLast = iScreenSize;
-            if ( iLast > iItemCount - 1 )
-            	{
-            	iLast = iItemCount - 1;
-            	}
-            }
-        else 
-            {
-            if ( iPosOnScreen == iScreenSize )
-                {
-                iPosOnScreen = 0;
-                iFirst += iScreenSize + 1;
-                iLast += iScreenSize + 1;
-                }
-            else
-                {
-                // Going down "in-screen", no need to update items
-                iPrevPosOnScreen = iPosOnScreen;
-                iPreventClearScreen = EFalse;
-                if (iItemCount > 0)
-                    {
-                    iPosOnScreen++;
-                    iPreventClearScreen = ETrue;
-                    }
-                }
-            }
+        MovePosition(1);
         break;
-        }
         
     // Go Up
     case EKeyUpArrow:
-        {                               
-        // The second condition is needed for the cursor not to go to "next" page (if it does not exist)
-        if ( iFirst + iPosOnScreen == 0 )
-            {
-            // If in the beginning of the list
-            if (iItemCount == iScreenSize + 1 || iItemCount == iScreenSize)
-                {
-                iPosOnScreen = iItemCount - 1;
-                }
-            else
-                {
-                iFirst = (iItemCount / iScreenSize) * iScreenSize;
-                iLast = iItemCount - 1;
-                iPosOnScreen = iItemCount % iScreenSize - 1;
-                if (iItemCount > iScreenSize)
-                    {
-                    iFirst++;
-                    iPosOnScreen--;
-                    }
-                }
-            }
-        else if ( iPosOnScreen == 0 )
-            {
-            iPosOnScreen = iScreenSize;
-            iLast -= iScreenSize + 1;
-            iFirst -= iScreenSize + 1;
-            }
-        else
-            {
-            iPrevPosOnScreen = iPosOnScreen;
-            iPosOnScreen--;
-            iPreventClearScreen = ETrue;
-            }
-        
+        MovePosition(-1);
         break;
-        }
 
     // Additional keys
     case EKeyHome:
     case '3':
-        iPosOnScreen = 0;
-        iFirst = 0;
-        iLast = iScreenSize;
-
-        if ( iLast > iItemCount - 1 )
-            {
-            iLast = iItemCount - 1;
-            }
+        MovePosition(-iFirst - iPosOnScreen);
         break;
 
     case EKeyEnd:
     case '9':
-        iLast = iItemCount - 1;
-        iFirst = iLast - iScreenSize;
-
-        if ( iFirst < 0 )
-            {
-            iFirst = 0;
-            }
-        iPosOnScreen = iLast - iFirst;        
+        MovePosition(iItemCount - 1 - iFirst - iPosOnScreen);
         break;
 
     case EKeyPageUp:
     case '1':
-
-        iFirst = iFirst - iScreenSize;
-        iLast = iLast - iScreenSize;
-
-        if ( iFirst < 0 )
-            {
-            iFirst = 0;
-            iPosOnScreen = 0;           
-            iLast = iScreenSize;
-            if ( iLast > iItemCount - 1 )
-                {
-                iLast = iItemCount - 1;
-                }
-            }
+        MovePosition((iFirst + iPosOnScreen - iScreenSize - 1 >= 0) ? (-iScreenSize - 1) : (-iFirst - iPosOnScreen));
         break;
 
     case EKeyPageDown:
     case '7':
-        iFirst = iFirst + iScreenSize;
-        iLast = iLast + iScreenSize;
-
-        // Going too far
-        if ( iLast > iItemCount - 1 )
-            {
-            iLast = iItemCount - 1;
-            iFirst = iLast - iScreenSize;
-            if ( iFirst < 0 )
-                {
-                iFirst = 0;
-                }
-            }
-        iPosOnScreen = iLast - iFirst;
+        MovePosition((iFirst + iPosOnScreen + iScreenSize + 1 < iItemCount) ? (iScreenSize + 1) : (iItemCount - 1 - iFirst - iPosOnScreen));
         break;
     default:  // Bypass the keypress
         break;
@@ -681,8 +641,8 @@
 void CMenu::Print( const TDesC& aPrint )
     {
     
-    iConsole->Printf ( aPrint.Left( iSize.iWidth - KMenuOverhead ) );
-    iConsole->Printf(_L("\n"));
+    iConsole->Write ( aPrint.Left( iSize.iWidth - KMenuOverhead ) );
+    iConsole->Write(_L("\n"));
 
     }
 
@@ -1120,7 +1080,7 @@
                 error.iText.AppendNum( ret );
                 iMain->Error( error );
                 }
-            return iParent;
+        return iParent;
             }
         else
             {
@@ -4428,17 +4388,23 @@
             {
             case EKeyEnter:
             case EKeyRightArrow:
-            	{           
-                
-                const TDesC& aSetName = iFileList.operator [](iPosOnScreen)->Des();
+                {           
+                if(iPosOnScreen < iFileList.Count())
+                    {
+                    const TDesC& aSetName = iFileList.operator [](iPosOnScreen)->Des();
                 
-                ret = iMain->UIStore().LoadTestSet( iFileList.operator [](iPosOnScreen)->Des() );
-                if (ret == KErrNone)
-                	{
-                	((CTestSetMenu*)iParent)->SetCreated();
-                	((CTestSetMenu*)iParent)->SetTestSetFileName(iFileList.operator [](iPosOnScreen)->Des());
-                	}
-                return iParent;
+                    ret = iMain->UIStore().LoadTestSet( iFileList.operator [](iPosOnScreen)->Des() );
+                    if (ret == KErrNone)
+                        {
+                        ((CTestSetMenu*)iParent)->SetCreated();
+                        ((CTestSetMenu*)iParent)->SetTestSetFileName(iFileList.operator [](iPosOnScreen)->Des());
+                        }
+                    return iParent;
+                    }
+                else
+                    {
+                    return this;
+                    }
                 }
             default:
                 break;
--- a/stif/TestServer/src/Testserversession.cpp	Fri Apr 16 16:37:27 2010 +0300
+++ b/stif/TestServer/src/Testserversession.cpp	Mon May 03 13:58:41 2010 +0300
@@ -358,9 +358,8 @@
         {
         TInt handle = 0;
         CObject* theObj = NULL;
-        TInt count = iTestExecutionHandle->Count();
-            
-        for( TInt i = 0 ; i < count; i++ )
+        TInt count = iTestExecutionHandle->Count();        
+        for ( TInt i = count - 1; i >= 0; i-- )
             {
             theObj=iTestExecutionHandle->operator[]( i );
             if( theObj )
@@ -374,7 +373,6 @@
 
         delete iTestExecutionHandle;
         iTestExecutionHandle = NULL;
-
         }
 
     // Deletion must be done here, because the "CloseSession" message is 
--- a/stif/TouchConsoleUI/src/Consolemenus.cpp	Fri Apr 16 16:37:27 2010 +0300
+++ b/stif/TouchConsoleUI/src/Consolemenus.cpp	Mon May 03 13:58:41 2010 +0300
@@ -476,13 +476,16 @@
             {
             // If in the beginning of the list
 
-            iLast = iItemCount - 1;
-            iFirst = iLast - iScreenSize;
-            if ( iFirst < 0 )
-            	{
-            	iFirst = 0;            	
-            	}
-            iPosOnScreen = iLast - iFirst;
+            if(iItemCount > 0)
+                {
+                iLast = iItemCount - 1;
+                iFirst = iLast - iScreenSize;
+                if ( iFirst < 0 )
+                	{
+                	iFirst = 0;            	
+                	}
+                iPosOnScreen = iLast - iFirst;
+                }
             }
         else if ( iPosOnScreen == 0 )
             {
@@ -4391,15 +4394,22 @@
             {
             case EKeyEnter:
             case EKeyRightArrow:
-                {
+                {           
+                if(iPosOnScreen < iFileList.Count())
+                    {
                 
-                ret = iMain->UIStore().LoadTestSet( iFileList.operator [](iPosOnScreen)->Des() );
-                if (ret == KErrNone)
-                	{
-                	((CTestSetMenu*)iParent)->SetCreated();
-                	((CTestSetMenu*)iParent)->SetTestSetFileName(iFileList.operator [](iPosOnScreen)->Des());
-                	}
-                return iParent;
+                    ret = iMain->UIStore().LoadTestSet( iFileList.operator [](iPosOnScreen)->Des() );
+                    if (ret == KErrNone)
+                        {
+                        ((CTestSetMenu*)iParent)->SetCreated();
+                        ((CTestSetMenu*)iParent)->SetTestSetFileName(iFileList.operator [](iPosOnScreen)->Des());
+                        }
+                    return iParent;
+                    }
+                else
+                    {
+                    return this;
+                    }
                 }
             default:
                 break;
--- a/stif/group/ReleaseNote.txt	Fri Apr 16 16:37:27 2010 +0300
+++ b/stif/group/ReleaseNote.txt	Mon May 03 13:58:41 2010 +0300
@@ -1,5 +1,5 @@
 ========================================================================
-RELEASE NOTE FOR STIF - STIF_201010 (7.3.28)
+RELEASE NOTE FOR STIF - STIF_201012 (7.3.29)
 SUPPORTING SERIES 60 3.0 ->
 ========================================================================
 
--- a/stif/inc/version.h	Fri Apr 16 16:37:27 2010 +0300
+++ b/stif/inc/version.h	Mon May 03 13:58:41 2010 +0300
@@ -20,9 +20,9 @@
 
 #define STIF_MAJOR_VERSION 7
 #define STIF_MINOR_VERSION 3
-#define STIF_BUILD_VERSION 28
+#define STIF_BUILD_VERSION 29
 
-#define STIF_REL_DATE "09th Mar 2010"
+#define STIF_REL_DATE "23th Mar 2010"
 
 #define TO_UNICODE(text) _L(text) 
 
Binary file stif/sis/Stif_31.sis has changed