|
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 using System; |
|
18 using System.Collections.Generic; |
|
19 using System.Text; |
|
20 using SymbianUtils.Tracer; |
|
21 using SymbianDebugLib.Engine; |
|
22 using SymbianDebugLib.PluginAPI.Types; |
|
23 using SymbianDebugLib.PluginAPI.Types.Code; |
|
24 using SymbianStructuresLib.Arm; |
|
25 using SymbianStructuresLib.Arm.Instructions; |
|
26 using SymbianStackAlgorithmAccurate.Engine; |
|
27 using SymbianStackAlgorithmAccurate.Instructions; |
|
28 |
|
29 namespace SymbianStackAlgorithmAccurate.Code |
|
30 { |
|
31 internal class ArmCodeHelper |
|
32 { |
|
33 #region Constructors |
|
34 public ArmCodeHelper( DbgViewCode aDebugViewCode, ITracer aTracer ) |
|
35 { |
|
36 iCodeView = aDebugViewCode; |
|
37 iTracer = aTracer; |
|
38 } |
|
39 #endregion |
|
40 |
|
41 #region API |
|
42 public uint LoadData( uint aAddress ) |
|
43 { |
|
44 uint ret = iCodeView.GetDataUInt32( aAddress ); |
|
45 return ret; |
|
46 } |
|
47 |
|
48 public AccInstructionList LoadInstructions( uint aAddress, int aCount, TArmInstructionSet aType ) |
|
49 { |
|
50 AccInstructionList ret = new AccInstructionList(); |
|
51 |
|
52 // Get list of instructions from code engine |
|
53 IArmInstruction[] basicInstructions = null; |
|
54 bool available = iCodeView.GetInstructions( aAddress, aType, aCount, out basicInstructions ); |
|
55 if ( available ) |
|
56 { |
|
57 // Convert the basic instructions into the different types |
|
58 // we can handle |
|
59 ret.AddRange( basicInstructions ); |
|
60 } |
|
61 // |
|
62 return ret; |
|
63 } |
|
64 #endregion |
|
65 |
|
66 #region Properties |
|
67 #endregion |
|
68 |
|
69 #region Internal methods |
|
70 #endregion |
|
71 |
|
72 #region Data members |
|
73 private readonly ITracer iTracer; |
|
74 private readonly DbgViewCode iCodeView; |
|
75 #endregion |
|
76 } |
|
77 } |