|
1 /* |
|
2 * Copyright (c) 2009 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 SymbianUtils.BasicTypes; |
|
22 using SymbianETMLib.Common.Utilities; |
|
23 using SymbianStructuresLib.Arm.Instructions; |
|
24 |
|
25 namespace SymbianETMLib.Common.Types |
|
26 { |
|
27 internal class ETMInstruction |
|
28 { |
|
29 #region Constructors |
|
30 public ETMInstruction() |
|
31 : this( 0 ) |
|
32 { |
|
33 } |
|
34 |
|
35 public ETMInstruction( uint aAddress ) |
|
36 : this( aAddress, null ) |
|
37 { |
|
38 } |
|
39 |
|
40 public ETMInstruction( uint aAddress, IArmInstruction aInstruction ) |
|
41 { |
|
42 iAddress = new SymAddress( aAddress ); |
|
43 iInstruction = aInstruction; |
|
44 } |
|
45 #endregion |
|
46 |
|
47 #region From System.Object |
|
48 public override string ToString() |
|
49 { |
|
50 string ret = string.Empty; |
|
51 if ( HaveInstruction ) |
|
52 { |
|
53 ret = iInstruction.ToString(); |
|
54 } |
|
55 return ret; |
|
56 } |
|
57 #endregion |
|
58 |
|
59 #region Properties |
|
60 public bool HaveInstruction |
|
61 { |
|
62 get { return iInstruction != null; } |
|
63 } |
|
64 |
|
65 public SymAddress Address |
|
66 { |
|
67 get { return iAddress; } |
|
68 set { iAddress = value; } |
|
69 } |
|
70 |
|
71 public uint AIRawValue |
|
72 { |
|
73 get |
|
74 { |
|
75 uint ret = 0; |
|
76 if ( HaveInstruction ) |
|
77 { |
|
78 ret = iInstruction.AIRawValue; |
|
79 } |
|
80 return ret; |
|
81 } |
|
82 } |
|
83 |
|
84 public IArmInstruction Instruction |
|
85 { |
|
86 get { return iInstruction; } |
|
87 set { iInstruction = value; } |
|
88 } |
|
89 #endregion |
|
90 |
|
91 #region Operators |
|
92 public static implicit operator uint( ETMInstruction aInstruction ) |
|
93 { |
|
94 uint ret = aInstruction.AIRawValue; |
|
95 return ret; |
|
96 } |
|
97 #endregion |
|
98 |
|
99 #region Data members |
|
100 private SymAddress iAddress = new SymAddress(); |
|
101 private IArmInstruction iInstruction = null; |
|
102 #endregion |
|
103 } |
|
104 } |