|
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.Types; |
|
23 |
|
24 namespace SymbianETMLib.Common.Packets |
|
25 { |
|
26 public class ETMPcktPHeaderFormat2 : ETMPcktPHeaderBase |
|
27 { |
|
28 #region Constructors |
|
29 public ETMPcktPHeaderFormat2() |
|
30 { |
|
31 // Format 2 P-header: |
|
32 // |
|
33 // b1000 FF 10 |
|
34 // 1 x (N/nE), 1 x (N/nE) |
|
35 // Bit [3] represents the first instruction and bit [2] represents the second instruction. |
|
36 // |
|
37 // Important Note: |
|
38 // |
|
39 // This is the opposite bit encoding to the PHeader1 !!! - I.e. a '1' indicates fail (N) and |
|
40 // a 0 indicates pass (E)!!! |
|
41 // |
|
42 // Example: |
|
43 // |
|
44 // A header of value b10001010 is encountered in the trace when cycle-accurate mode is disabled. This is a |
|
45 // format 2 P-header representing the atoms NE. It indicates that one instruction was executed that failed its |
|
46 // condition codes, followed by one instruction that passed its condition codes. |
|
47 // |
|
48 base.SetMask( "1000 ## 10" ); |
|
49 } |
|
50 |
|
51 static ETMPcktPHeaderFormat2() |
|
52 { |
|
53 iAtomMask1 = new SymMask( "1###", SymMask.TShiftDirection.ERight, 3 ); |
|
54 iAtomMask2 = new SymMask( "#1##", SymMask.TShiftDirection.ERight, 2 ); |
|
55 } |
|
56 #endregion |
|
57 |
|
58 #region API |
|
59 #endregion |
|
60 |
|
61 #region From PcktBase |
|
62 #endregion |
|
63 |
|
64 #region Properties |
|
65 public ETMPcktPHeaderBase.TAtomType Atom1Type |
|
66 { |
|
67 get |
|
68 { |
|
69 uint val = iAtomMask1.Apply( base.RawByte ); |
|
70 ETMPcktPHeaderBase.TAtomType ret = TAtomType.EAtomN_Failed; |
|
71 if ( val == 0 ) |
|
72 { |
|
73 ret = ETMPcktPHeaderBase.TAtomType.EAtomE_Passed; |
|
74 } |
|
75 return ret; |
|
76 } |
|
77 } |
|
78 |
|
79 public ETMPcktPHeaderBase.TAtomType Atom2Type |
|
80 { |
|
81 get |
|
82 { |
|
83 uint val = iAtomMask2.Apply( base.RawByte ); |
|
84 ETMPcktPHeaderBase.TAtomType ret = TAtomType.EAtomN_Failed; |
|
85 if ( val == 0 ) |
|
86 { |
|
87 ret = ETMPcktPHeaderBase.TAtomType.EAtomE_Passed; |
|
88 } |
|
89 return ret; |
|
90 } |
|
91 } |
|
92 #endregion |
|
93 |
|
94 #region Internal constants |
|
95 #endregion |
|
96 |
|
97 #region From System.Object |
|
98 #endregion |
|
99 |
|
100 #region Data members |
|
101 private readonly static SymMask iAtomMask1; |
|
102 private readonly static SymMask iAtomMask2; |
|
103 #endregion |
|
104 } |
|
105 } |