memspy/Engine/Source/Helpers/MemSpyEngineHelperStack.cpp
branchRCL_3
changeset 39 3406c99bc375
parent 0 a03f92240627
child 43 ca8a1b6995f6
equal deleted inserted replaced
32:8f8df8006c40 39:3406c99bc375
   248         _LIT(KStackDataPrefix, "%S");
   248         _LIT(KStackDataPrefix, "%S");
   249         r = iEngine.Driver().GetStackData( aThread.Id(), pData, remaining, aType, aEntireStack );
   249         r = iEngine.Driver().GetStackData( aThread.Id(), pData, remaining, aType, aEntireStack );
   250 
   250 
   251         if  ( r == KErrNone )
   251         if  ( r == KErrNone )
   252             {
   252             {
   253             while ( r == KErrNone )
   253             if ( aType == EMemSpyDriverDomainUser ) {
   254                 {
   254                 while ( r == KErrNone )
   255                 iEngine.Sink().OutputBinaryDataL( KStackDataPrefix, pData.Ptr(), (const TUint8*) info.iUserStackBase, pData.Length() );
       
   256                 //
       
   257                 if  ( remaining > 0 )
       
   258                     {
   255                     {
   259                     info.iUserStackBase += pData.Length();
   256                     iEngine.Sink().OutputBinaryDataL( KStackDataPrefix, pData.Ptr(), (const TUint8*) info.iUserStackBase, pData.Length() );
   260                     r = iEngine.Driver().GetStackDataNext( aThread.Id(), pData, remaining, aType, aEntireStack );
   257                     //
       
   258                     if  ( remaining > 0 )
       
   259                         {
       
   260                         info.iUserStackBase += pData.Length();
       
   261                         r = iEngine.Driver().GetStackDataNext( aThread.Id(), pData, remaining, aType, aEntireStack );
       
   262                         }
       
   263                     else
       
   264                         {
       
   265                         break;
       
   266                         }
   261                     }
   267                     }
   262                 else
   268             }
   263                     {
   269             else if ( aType == EMemSpyDriverDomainKernel ) {
   264                     break;
   270                 while ( r == KErrNone ) {
       
   271                 
       
   272                     iEngine.Sink().OutputBinaryDataL( KStackDataPrefix, pData.Ptr(), (const TUint8*) info.iSupervisorStackBase, pData.Length() );
       
   273                     //
       
   274                     if  ( remaining > 0 ) {
       
   275                         info.iSupervisorStackBase += pData.Length();
       
   276                         r = iEngine.Driver().GetStackDataNext( aThread.Id(), pData, remaining, aType, aEntireStack );
   265                     }
   277                     }
   266                 }
   278                     else {
   267             }
   279                          break;
   268 
   280                     }
       
   281                }
       
   282             }
   269         }
   283         }
   270     CleanupStack::PopAndDestroy( data );
   284     CleanupStack::PopAndDestroy( data );
   271 
   285 
   272     CleanupStack::PopAndDestroy(); // clear prefix
   286     CleanupStack::PopAndDestroy(); // clear prefix
   273     CleanupStack::PopAndDestroy(); // resume process
   287     CleanupStack::PopAndDestroy(); // resume process
   274 
   288 
   275     // End marker
   289     // End marker
   276     iEngine.Sink().OutputLineFormattedL( KMemSpyMarkerStackData, &KMemSpySinkTagClose, (TUint) aThread.Id() );
   290     iEngine.Sink().OutputLineFormattedL( KMemSpyMarkerStackData, &KMemSpySinkTagClose, (TUint) aThread.Id() );
   277     iEngine.Sink().DataStreamEndL();
   291     iEngine.Sink().DataStreamEndL();
   278     }
   292     }
       
   293 }    
   279 
   294 
   280 
   295 
   281 EXPORT_C void CMemSpyEngineHelperStack::OutputStackInfoForDeviceL()
   296 EXPORT_C void CMemSpyEngineHelperStack::OutputStackInfoForDeviceL()
   282     {
   297     {
   283     const TInt count = iEngine.Container().Count();
   298     const TInt count = iEngine.Container().Count();