sl@0
|
1 |
// Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
// e32\memmodel\epoc\moving\mmonitor.cpp
|
sl@0
|
15 |
// Kernel crash debugger - machine independent portion
|
sl@0
|
16 |
//
|
sl@0
|
17 |
//
|
sl@0
|
18 |
|
sl@0
|
19 |
#include <kernel/monitor.h>
|
sl@0
|
20 |
#include "memmodel.h"
|
sl@0
|
21 |
|
sl@0
|
22 |
void Monitor::DumpMemModelProcessData(DProcess* aProcess)
|
sl@0
|
23 |
{
|
sl@0
|
24 |
DMemModelProcess* pP=(DMemModelProcess*)aProcess;
|
sl@0
|
25 |
Printf("NumChunks=%d\r\n",pP->iNumChunks);
|
sl@0
|
26 |
TInt i;
|
sl@0
|
27 |
for (i=0; i<pP->iNumChunks; i++)
|
sl@0
|
28 |
{
|
sl@0
|
29 |
DMemModelProcess::SChunkInfo& ci=pP->iChunks[i];
|
sl@0
|
30 |
Printf("%d: Chunk %08x, run %08x, access count %d\r\n",i,ci.iChunk,ci.iDataSectionBase,ci.iAccessCount);
|
sl@0
|
31 |
}
|
sl@0
|
32 |
}
|
sl@0
|
33 |
|
sl@0
|
34 |
void Monitor::DumpChunkData(DChunk* aChunk)
|
sl@0
|
35 |
{
|
sl@0
|
36 |
DMemModelChunk* pC=(DMemModelChunk*)aChunk;
|
sl@0
|
37 |
Printf("Owning Process %08x\r\n",pC->iOwningProcess);
|
sl@0
|
38 |
Printf("Size %x, MaxSize %x, Base %08x\r\n",pC->iSize,pC->iMaxSize,pC->iBase);
|
sl@0
|
39 |
Printf("Attrib %x, StartPos %x\r\n",pC->iAttributes,pC->iStartPos);
|
sl@0
|
40 |
Printf("Type %d, State %d, Home Base %08x\r\n",pC->iChunkType,pC->iChunkState,pC->iHomeBase);
|
sl@0
|
41 |
Printf("Home Region Offset %08x\r\n",pC->iHomeRegionOffset);
|
sl@0
|
42 |
Printf("Home Region Base %08x\r\n",pC->iHomeRegionBase);
|
sl@0
|
43 |
Printf("Home Region Size %08x\r\n",pC->iHomeRegionSize);
|
sl@0
|
44 |
Printf("PTE: %08x, PDE: %08x %08x %08x\r\n", pC->iPtePermissions,
|
sl@0
|
45 |
pC->iPdePermissions[0],pC->iPdePermissions[1],pC->iPdePermissions[2]);
|
sl@0
|
46 |
Printf("NumPdes=%d, iPdes=%08x, iHomePdes=%08x\r\n",pC->iNumPdes,pC->iPdes,pC->iHomePdes);
|
sl@0
|
47 |
Printf("PdeBitMap=%08x, PageBitMap=%08x\r\n",
|
sl@0
|
48 |
pC->iPdeBitMap, pC->iPageBitMap);
|
sl@0
|
49 |
DumpCpuChunkData(pC);
|
sl@0
|
50 |
}
|
sl@0
|
51 |
|
sl@0
|
52 |
void Monitor::MMProcessInfoCommand()
|
sl@0
|
53 |
{
|
sl@0
|
54 |
TScheduler* pS=TScheduler::Ptr();
|
sl@0
|
55 |
DMonObject* pA=(DMonObject*)pS->iAddressSpace;
|
sl@0
|
56 |
DMonObject* pV=(DMonObject*)pS->iExtras[0];
|
sl@0
|
57 |
DMonObject* pD=(DMonObject*)pS->iExtras[1];
|
sl@0
|
58 |
DMonObject* pC=(DMonObject*)pS->iExtras[2];
|
sl@0
|
59 |
Printf("TheCurrentAddressSpace=%08x\r\n",pA);
|
sl@0
|
60 |
Printf("TheCurrentVMProcess=%08x\r\n",pV);
|
sl@0
|
61 |
Monitor::DumpObjectData(pV,EProcess);
|
sl@0
|
62 |
Printf("TheCurrentDataSectionProcess=%08x\r\n",pD);
|
sl@0
|
63 |
Printf("TheCompleteDataSectionProcess=%08x\r\n",pC);
|
sl@0
|
64 |
Monitor::DumpObjectData(pC,EProcess);
|
sl@0
|
65 |
}
|
sl@0
|
66 |
|
sl@0
|
67 |
void Monitor::MDisplayCodeSeg(DCodeSeg* aSeg)
|
sl@0
|
68 |
{
|
sl@0
|
69 |
DMemModelCodeSeg* seg = (DMemModelCodeSeg*) aSeg;
|
sl@0
|
70 |
Printf(" iCodeAllocBase: %08x\r\n",seg->iCodeAllocBase);
|
sl@0
|
71 |
Printf(" iDataAllocBase: %08x\r\n",seg->iDataAllocBase);
|
sl@0
|
72 |
Printf(" iKernelData: %08x\r\n",seg->iKernelData);
|
sl@0
|
73 |
}
|
sl@0
|
74 |
|
sl@0
|
75 |
EXPORT_C TUint Monitor::MapAndLocateUserStack(DThread* aThread)
|
sl@0
|
76 |
{
|
sl@0
|
77 |
TLinAddr stackBase=aThread->iUserStackRunAddress;
|
sl@0
|
78 |
TLinAddr stackTop=stackBase+aThread->iUserStackSize;
|
sl@0
|
79 |
DMemModelProcess* pP=(DMemModelProcess*)aThread->iOwningProcess;
|
sl@0
|
80 |
if (!pP || ((DMonObject*)pP)->Type()!=EProcess)
|
sl@0
|
81 |
return 0;
|
sl@0
|
82 |
for(TInt i=0 ; i<pP->iNumChunks ; ++i)
|
sl@0
|
83 |
{
|
sl@0
|
84 |
DMemModelProcess::SChunkInfo& info=pP->iChunks[i];
|
sl@0
|
85 |
DMemModelChunk* pC=info.iChunk;
|
sl@0
|
86 |
if (!pC || ((DMonObject*)pC)->Type()!=EChunk)
|
sl@0
|
87 |
continue;
|
sl@0
|
88 |
if (stackBase >= info.iDataSectionBase &&
|
sl@0
|
89 |
stackTop <= info.iDataSectionBase+pC->MaxSize())
|
sl@0
|
90 |
return (TUint)pC->iBase+(stackBase-info.iDataSectionBase);
|
sl@0
|
91 |
}
|
sl@0
|
92 |
return 0;
|
sl@0
|
93 |
}
|
sl@0
|
94 |
|
sl@0
|
95 |
EXPORT_C TInt Monitor::SwitchAddressSpace(DProcess*, TBool)
|
sl@0
|
96 |
{
|
sl@0
|
97 |
return KErrNone;
|
sl@0
|
98 |
}
|