First public contribution.
1 // Copyright (c) 1994-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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Kernel crash debugger - machine independent portion
17 #define INCLUDED_FROM_ASM // Make DMemModelProcess::iOsAsid public, safe to
18 // do here as the system has crashed and the inline
19 // DMemModelProcess::OsAsid() requires too much kernel knowlodge.
21 #include <kernel/monitor.h>
24 void Monitor::DumpMemModelProcessData(DProcess* aProcess)
26 DMemModelProcess* pP=(DMemModelProcess*)aProcess;
27 // Read the os asid without opening a reference as after the crash this
28 // is the only running thread.
29 Printf("OS ASID=%d, LPD=%08x\r\n",pP->iOsAsid,pP->iPageDir);
30 Printf("ChunkCount=%d ChunkAlloc=%d\r\n",pP->iChunkCount,pP->iChunkAlloc);
32 for (i=0; i<pP->iChunkCount; i++)
34 DMemModelProcess::SChunkInfo& ci=pP->iChunks[i];
35 Printf("%d: Chunk %08x, access count %d\r\n",i,ci.iChunk,ci.iAccessCount);
39 void Monitor::DumpChunkData(DChunk* aChunk)
41 DMemModelChunk* pC=(DMemModelChunk*)aChunk;
42 Printf("Owning Process %08x OS ASIDS %08x\r\n",pC->iOwningProcess);
43 Printf("Size %x, MaxSize %x\r\n",pC->iSize,pC->iMaxSize);
44 Printf("Attrib %x, StartPos %x\r\n",pC->iAttributes,pC->iStartPos);
45 Printf("Type %d\r\n",pC->iChunkType);
46 Printf("PageBitMap=%08x\r\n",pC->iPageBitMap);
50 void Monitor::MMProcessInfoCommand()
52 TScheduler* pS=TScheduler::Ptr();
55 for (i=0; i<KMaxCpus; ++i)
57 DMonObject* pA = (DMonObject*)pS->iSub[i]->iAddressSpace;
58 Printf("CPU%d: TheCurrentAddressSpace=%08x\r\n",i,pA);
61 DMonObject* pA=(DMonObject*)pS->iAddressSpace;
62 Printf("TheCurrentAddressSpace=%08x\r\n",pA);
66 void Monitor::MDisplayCodeSeg(DCodeSeg* aSeg)
68 DMemModelCodeSeg* seg = (DMemModelCodeSeg*) aSeg;
69 DMemModelCodeSegMemory* mem = seg->Memory();
70 Printf(" iKernelData: %08x\r\n",seg->iKernelData);
71 Printf(" iCreator: %08x\r\n",mem ? mem->iCreator : 0);
74 extern TInt MapProcess(DMemModelProcess* aProcess, TBool aForce);
76 EXPORT_C TUint Monitor::MapAndLocateUserStack(DThread* aThread)
78 DMemModelProcess* pP=(DMemModelProcess*)aThread->iOwningProcess;
79 TInt r = SwitchAddressSpace(pP, EFalse);
82 return aThread->iUserStackRunAddress;
85 EXPORT_C TInt Monitor::SwitchAddressSpace(DProcess* aProcess, TBool aForce)
87 return MapProcess((DMemModelProcess*)aProcess, aForce);