kernel/eka/nkern/nk_mon.cpp
branchRCL_3
changeset 43 c1f20ce4abcf
equal deleted inserted replaced
42:a179b74831c9 43:c1f20ce4abcf
       
     1 // Copyright (c) 2009-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of the License "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // e32\nkern\nk_mon.cpp
       
    15 // Kernel crash debugger - NKERN platform-independent portion
       
    16 // 
       
    17 //
       
    18 
       
    19 #include <kernel/monitor.h>
       
    20 #include "nk_priv.h"
       
    21 
       
    22 extern void DisplayNThreadPlatformSpecific(Monitor& m, NThread* pT);
       
    23 
       
    24 
       
    25 EXPORT_C void Monitor::DisplayNThreadInfo(NThread* pT)
       
    26 	{
       
    27 	TBuf8<80> buf=_L8("NThread @ ");
       
    28 	buf.AppendNumFixedWidth((TUint)pT,EHex,8);
       
    29 	buf+=_L8(" Pri ");
       
    30 	buf.AppendNum((TUint)pT->iPriority);
       
    31 	buf+=_L8(" NState ");
       
    32 	switch (pT->iSpare1)
       
    33 		{
       
    34 		case NThread::EReady: buf+=_L8("READY"); break;
       
    35 		case NThread::ESuspended: buf+=_L8("SUSPENDED"); break;
       
    36 		case NThread::EWaitFastSemaphore: buf+=_L8("WAITFSEM "); buf.AppendNumFixedWidth((TUint)pT->iWaitObj,EHex,8); break;
       
    37 		case NThread::ESleep: buf+=_L8("SLEEP"); break;
       
    38 		case NThread::EBlocked: buf+=_L8("BLOCKED"); break;
       
    39 		case NThread::EDead: buf+=_L8("DEAD"); break;
       
    40 		case NThread::EWaitDfc: buf+=_L8("WAITDFC"); break;
       
    41 		default: buf+=_L8("??"); buf.AppendNumFixedWidth((TUint)pT->iSpare1,EHex,8); break;
       
    42 		}
       
    43 	PrintLine(buf);
       
    44 	Printf("SavedSP=%08x Next=%08x Prev=%08x Att=%02x\r\n",pT->iSavedSP,pT->iNext,pT->iPrev,pT->iSpare2);
       
    45 	Printf("HeldFM=%08x WaitFM=%08x AddrSp=%08x\r\n",pT->iHeldFastMutex,pT->iWaitFastMutex,pT->iAddressSpace);
       
    46 	Printf("Time=%d Timeslice=%d ReqCount=%d\r\n",pT->iTime,pT->iTimeslice,pT->iRequestSemaphore.iCount);
       
    47 	Printf("SuspendCount=%d CsCount=%d CsFunction=%08x\r\n",pT->iSuspendCount,pT->iCsCount,pT->iCsFunction);
       
    48 	Printf("iUserModeCallbacks=%08x iSpare7=%08x iSpare8=%08x\r\n", pT->iUserModeCallbacks, pT->iSpare7, pT->iSpare8);
       
    49 	DisplayNThreadPlatformSpecific(*this, pT);
       
    50 	NewLine();
       
    51 	}
       
    52 
       
    53 void Monitor::DisplayNFastSemInfo(NFastSemaphore* pS)
       
    54 	{
       
    55 	Printf("NFastSemaphore @ %08x Count %d OwningThread %08x\r\n",pS,pS->iCount,pS->iOwningThread);
       
    56 	}
       
    57 
       
    58 void Monitor::DisplayNFastMutexInfo(NFastMutex* pM)
       
    59 	{
       
    60 	Printf("NFastMutex @ %08x HoldingThread %08x iWaiting %08x\r\n",pM,pM->iHoldingThread,pM->iWaiting);
       
    61 	}
       
    62 
       
    63 void Monitor::DisplaySchedulerInfo()
       
    64 	{
       
    65 	TScheduler* pS=TScheduler::Ptr();
       
    66 	Printf("SCHEDULER @%08x: CurrentThread %08x\r\n",pS,pS->iCurrentThread);
       
    67 	Printf("RescheduleNeeded=%02x DfcPending=%02x KernCSLocked=%08x\r\n",pS->iRescheduleNeededFlag,pS->iDfcPendingFlag,pS->iKernCSLocked);
       
    68 	Printf("DFCS: next %08x prev %08x\r\n",pS->iDfcs.iA.iNext,pS->iDfcs.iA.iPrev);
       
    69 	Printf("ProcessHandler=%08x, AddressSpace=%08x\r\n",pS->iProcessHandler,pS->iAddressSpace);
       
    70 	Printf("SYSLOCK: HoldingThread %08x iWaiting %08x\r\n",pS->iLock.iHoldingThread,pS->iLock.iWaiting);
       
    71 	Printf("Extras 0: %08x 1: %08x 2: %08x 3: %08x\r\n",pS->iExtras[0],pS->iExtras[1],pS->iExtras[2],pS->iExtras[3]);
       
    72 	Printf("Extras 4: %08x 5: %08x 6: %08x 7: %08x\r\n",pS->iExtras[4],pS->iExtras[5],pS->iExtras[6],pS->iExtras[7]);
       
    73 	Printf("Extras 8: %08x 9: %08x A: %08x B: %08x\r\n",pS->iExtras[8],pS->iExtras[9],pS->iExtras[10],pS->iExtras[11]);
       
    74 	Printf("Extras C: %08x D: %08x E: %08x F: %08x\r\n",pS->iExtras[12],pS->iExtras[13],pS->iExtras[14],pS->iExtras[15]);
       
    75 	}
       
    76