|
1 /* |
|
2 * Copyright (c) 2004-2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 using System; |
|
19 using System.Collections.Generic; |
|
20 using System.Text; |
|
21 using SymbianParserLib.Engine; |
|
22 using CrashDebuggerLib.Structures.KernelObjects; |
|
23 using CrashDebuggerLib.Structures.Chunk; |
|
24 using CrashDebuggerLib.Structures.CodeSeg; |
|
25 using SymbianParserLib.Elements; |
|
26 using SymbianParserLib.Enums; |
|
27 using SymbianParserLib.BaseStructures; |
|
28 |
|
29 namespace CrashDebuggerLib.Parsers.State.Implementation.Helpers |
|
30 { |
|
31 internal class HelperDChunk : HelperDObject |
|
32 { |
|
33 #region Constructors |
|
34 public HelperDChunk() |
|
35 { |
|
36 } |
|
37 #endregion |
|
38 |
|
39 #region API |
|
40 public void CreateMonitorChunk( ParserEngine aEngine, string aName, DChunk aChunk ) |
|
41 { |
|
42 ParserParagraph para0 = base.CreateMonitorObjectParagraph( aName, aChunk ); |
|
43 aEngine.Add( para0 ); |
|
44 ParserParagraph para1 = CreateChunkMultiple( aName, aChunk ); |
|
45 aEngine.Add( para1 ); |
|
46 |
|
47 // TODO: add support for older memory models? |
|
48 } |
|
49 #endregion |
|
50 |
|
51 #region Call-back methods |
|
52 #endregion |
|
53 |
|
54 #region Internal methods |
|
55 private ParserParagraph CreateChunkMultiple( string aName, DChunk aChunk ) |
|
56 { |
|
57 ParserParagraph para = new ParserParagraph( aName ); |
|
58 // |
|
59 ParserLine l1 = ParserLine.NewSymFormat( "Owning Process %08x OS ASIDS %08x\r\n" ); |
|
60 l1.SetTargetProperties( aChunk, "OwningProcessAddress", "OSAsids" ); |
|
61 // |
|
62 ParserLine l2 = ParserLine.NewSymFormat( "Size %x, MaxSize %x, Base %08x\r\n" ); |
|
63 l2.SetTargetProperties( aChunk, "Size", "MaxSize", "Base" ); |
|
64 // |
|
65 ParserLine l3 = ParserLine.NewSymFormat( "Attrib %x, StartPos %x\r\n" ); |
|
66 l3.SetTargetProperties( aChunk, "Attributes", "StartPos" ); |
|
67 // |
|
68 ParserLine l4 = ParserLine.NewSymFormat( "Type %d\r\n" ); |
|
69 l4.SetTargetProperty( aChunk, "ChunkType" ); |
|
70 // |
|
71 ParserLine l5 = ParserLine.NewSymFormat( "PTE: %08x, PDE: %08x\r\n" ); |
|
72 l5.SetTargetProperties( aChunk.Permissions, "Pte", "Pde" ); |
|
73 // |
|
74 ParserLine l6 = ParserLine.NewSymFormat( "PageTables=%08x, PageBitMap=%08x\r\n" ); |
|
75 l6.SetTargetProperties( aChunk, "PageTables", "PageBitMap" ); |
|
76 |
|
77 para.Add( l1, l2, l3, l4, l5, l6 ); |
|
78 return para; |
|
79 } |
|
80 #endregion |
|
81 } |
|
82 } |