~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to src/core/Mono.Debugging/Mono.Debugging.Client/BreakEventInfo.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
        public class BreakEventInfo
35
35
        {
36
36
                DebuggerSession session;
 
37
                int adjustedColumn = -1;
37
38
                int adjustedLine = -1;
38
39
                
39
40
                /// <summary>
55
56
                /// Gets a description of the status
56
57
                /// </summary>
57
58
                public string StatusMessage { get; private set; }
58
 
                
 
59
 
59
60
                internal void AttachSession (DebuggerSession s, BreakEvent ev)
60
61
                {
61
62
                        session = s;
62
63
                        BreakEvent = ev;
63
64
                        session.NotifyBreakEventStatusChanged (BreakEvent);
64
 
                        if (adjustedLine != -1)
65
 
                                session.AdjustBreakpointLocation ((Breakpoint)BreakEvent, adjustedLine);
 
65
                        if (adjustedLine != -1 || adjustedColumn != -1)
 
66
                                session.AdjustBreakpointLocation ((Breakpoint)BreakEvent, adjustedLine, adjustedColumn);
66
67
                }
67
68
 
68
69
                /// <summary>
81
82
                /// This line adjustment has effect only during the debug session, and is automatically
82
83
                /// reset when it terminates.
83
84
                /// </remarks>
84
 
                public void AdjustBreakpointLocation (int newLine)
 
85
                public void AdjustBreakpointLocation (int newLine, int newColumn)
85
86
                {
86
 
                        if (session != null)
87
 
                                session.AdjustBreakpointLocation ((Breakpoint)BreakEvent, newLine);
88
 
                        else
 
87
                        if (session != null) {
 
88
                                session.AdjustBreakpointLocation ((Breakpoint)BreakEvent, newLine, newColumn);
 
89
                        } else {
 
90
                                adjustedColumn = newColumn;
89
91
                                adjustedLine = newLine;
90
 
                }
91
 
                
 
92
                        }
 
93
                }
 
94
 
 
95
                /// <summary>
 
96
                /// Increments the hit count.
 
97
                /// </summary>
 
98
                /// <returns><c>true</c> if the break event should trigger, or <c>false</c> otherwise.</returns>
 
99
                public bool HitCountReached
 
100
                {
 
101
                        get {
 
102
                                switch (BreakEvent.HitCountMode) {
 
103
                                case HitCountMode.LessThan:
 
104
                                        return BreakEvent.CurrentHitCount < BreakEvent.HitCount;
 
105
                                case HitCountMode.LessThanOrEqualTo:
 
106
                                        return BreakEvent.CurrentHitCount <= BreakEvent.HitCount;
 
107
                                case HitCountMode.EqualTo:
 
108
                                        return BreakEvent.CurrentHitCount == BreakEvent.HitCount;
 
109
                                case HitCountMode.GreaterThan:
 
110
                                        return BreakEvent.CurrentHitCount > BreakEvent.HitCount;
 
111
                                case HitCountMode.GreaterThanOrEqualTo:
 
112
                                        return BreakEvent.CurrentHitCount >= BreakEvent.HitCount;
 
113
                                default:
 
114
                                        return true;
 
115
                                }
 
116
                        }
 
117
                }
 
118
 
 
119
                public void IncrementHitCount ()
 
120
                {
 
121
                        if (BreakEvent.HitCountMode != HitCountMode.None) {
 
122
                                BreakEvent.CurrentHitCount++;
 
123
                                BreakEvent.NotifyUpdate ();
 
124
                        }
 
125
                }
 
126
 
 
127
                [Obsolete ("Use IncrementHitCount() instead")]
92
128
                public void UpdateHitCount (int count)
93
129
                {
94
 
                        BreakEvent.HitCount = count;
 
130
                        BreakEvent.CurrentHitCount = count;
95
131
                        BreakEvent.NotifyUpdate ();
96
132
                }
97
133