|
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 CrashDebuggerLib.Structures.KernelObjects; |
|
22 using CrashDebuggerLib.Structures.Common; |
|
23 |
|
24 namespace CrashDebuggerLib.Structures.CodeSeg |
|
25 { |
|
26 public class CodeSegEntry : CrashDebuggerAware |
|
27 { |
|
28 #region Constructors |
|
29 public CodeSegEntry( CrashDebuggerInfo aCrashDebugger ) |
|
30 : this( aCrashDebugger, 0, string.Empty ) |
|
31 { |
|
32 } |
|
33 |
|
34 public CodeSegEntry( CrashDebuggerInfo aCrashDebugger, uint aAddress, string aFileName ) |
|
35 : base( aCrashDebugger ) |
|
36 { |
|
37 KernelAddress = aAddress; |
|
38 FileName = aFileName; |
|
39 } |
|
40 #endregion |
|
41 |
|
42 #region API |
|
43 #endregion |
|
44 |
|
45 #region Properties |
|
46 public uint KernelAddress |
|
47 { |
|
48 get { return iKernelAddress; } |
|
49 set { iKernelAddress = value; } |
|
50 } |
|
51 |
|
52 public uint RunAddress |
|
53 { |
|
54 get { return iRunAddress; } |
|
55 set { iRunAddress = value; } |
|
56 } |
|
57 |
|
58 public uint RunAddressEnd |
|
59 { |
|
60 get { return RunAddress + Size; } |
|
61 } |
|
62 |
|
63 public uint Size |
|
64 { |
|
65 get { return iSize; } |
|
66 set { iSize = value; } |
|
67 } |
|
68 |
|
69 public string FileName |
|
70 { |
|
71 get { return iFileName; } |
|
72 set { iFileName = value; } |
|
73 } |
|
74 #endregion |
|
75 |
|
76 #region Internal methods |
|
77 #endregion |
|
78 |
|
79 #region Internal constants |
|
80 #endregion |
|
81 |
|
82 #region From System.Object |
|
83 public override string ToString() |
|
84 { |
|
85 StringBuilder ret = new StringBuilder(); |
|
86 // |
|
87 ret.Append( RunAddress.ToString( "x8" ) ); |
|
88 if ( Size != 0 ) |
|
89 { |
|
90 ret.Append( "-" ); |
|
91 ret.Append( RunAddressEnd.ToString( "x8" ) ); |
|
92 } |
|
93 ret.Append( " " ); |
|
94 ret.Append( FileName ); |
|
95 // |
|
96 return ret.ToString(); |
|
97 } |
|
98 #endregion |
|
99 |
|
100 #region Data members |
|
101 private uint iKernelAddress = 0; |
|
102 private uint iRunAddress = 0; |
|
103 private uint iSize = 0; |
|
104 private string iFileName = string.Empty; |
|
105 #endregion |
|
106 } |
|
107 } |