|
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.Text; |
|
19 using System.Collections.Generic; |
|
20 using CrashItemLib.Crash.Container; |
|
21 using CrashItemLib.Crash.Stacks; |
|
22 using CrashItemLib.Crash.Registers; |
|
23 using CrashItemLib.Crash.Base; |
|
24 using CrashItemLib.Crash.Messages; |
|
25 using CrashItemLib.Crash.Summarisable; |
|
26 using SymbianStructuresLib.Arm.Registers; |
|
27 using SymbianUtils.Range; |
|
28 |
|
29 namespace CrashItemLib.Engine.ProblemDetectors.Stack |
|
30 { |
|
31 internal class CIPDStackRegisterAvailability : CIProblemDetector |
|
32 { |
|
33 #region Constructors |
|
34 public CIPDStackRegisterAvailability() |
|
35 { |
|
36 } |
|
37 #endregion |
|
38 |
|
39 #region From CIProblemDetector |
|
40 public override void Check( CIContainer aContainer ) |
|
41 { |
|
42 CISummarisableEntityList list = aContainer.Summaries; |
|
43 foreach ( CISummarisableEntity entry in list ) |
|
44 { |
|
45 bool stackAvailable = entry.IsAvailable( CISummarisableEntity.TElement.EElementStack ); |
|
46 if ( stackAvailable ) |
|
47 { |
|
48 CIStack stack = entry.Stack; |
|
49 // |
|
50 bool regsAvailable = entry.IsAvailable( CISummarisableEntity.TElement.EElementRegisters ); |
|
51 if ( regsAvailable ) |
|
52 { |
|
53 bool pointerAvailable = stack.Registers.Contains( TArmRegisterType.EArmReg_SP ); |
|
54 // |
|
55 if ( pointerAvailable == false && stack.RawDataLength > 0 ) |
|
56 { |
|
57 base.CreateWarning( aContainer, stack, |
|
58 LibResources.CIPDStackRegisterAvailability_MissingSP_Title, |
|
59 string.Format( LibResources.CIPDStackRegisterAvailability_MissingSP_Description, base.CreateIdentifierText( entry ) ) |
|
60 ); |
|
61 } |
|
62 } |
|
63 else |
|
64 { |
|
65 base.CreateWarning( aContainer, stack, |
|
66 LibResources.CIPDStackRegisterAvailability_MissingRegisters_Title, |
|
67 string.Format( LibResources.CIPDStackRegisterAvailability_MissingRegisters_Description, base.CreateIdentifierText( entry ) ) |
|
68 ); |
|
69 } |
|
70 } |
|
71 } |
|
72 } |
|
73 #endregion |
|
74 |
|
75 #region Properties |
|
76 #endregion |
|
77 |
|
78 #region Internal methods |
|
79 #endregion |
|
80 |
|
81 #region From System.Object |
|
82 #endregion |
|
83 |
|
84 #region Data members |
|
85 #endregion |
|
86 } |
|
87 } |