~ubuntu-branches/ubuntu/oneiric/monodevelop/oneiric

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2011-06-27 17:03:13 UTC
  • mto: (1.8.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 54.
  • Revision ID: james.westby@ubuntu.com-20110627170313-6cvz3s19x6e9hqe9
ImportĀ upstreamĀ versionĀ 2.5.92+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
                                return null;
92
92
                }
93
93
                
 
94
                /// <summary>
 
95
                /// Gets or sets a value indicating whether this <see cref="Mono.Debugging.Client.BreakEvent"/> is enabled.
 
96
                /// </summary>
 
97
                /// <value>
 
98
                /// <c>true</c> if enabled; otherwise, <c>false</c>.
 
99
                /// </value>
 
100
                /// <remarks>
 
101
                /// Changes in this property are automatically applied. There is no need to call CommitChanges().
 
102
                /// </remarks>
94
103
                public bool Enabled {
95
104
                        get {
96
 
                                if (store == null)
97
 
                                        throw new InvalidOperationException ();
98
105
                                return enabled;
99
106
                        }
100
107
                        set {
101
 
                                if (store == null)
102
 
                                        throw new InvalidOperationException ();
103
 
                                if (store.IsReadOnly)
 
108
                                if (store != null && store.IsReadOnly)
104
109
                                        return;
105
110
                                enabled = value;
106
 
                                store.EnableBreakEvent (this, value);
 
111
                                if (store != null)
 
112
                                        store.EnableBreakEvent (this, value);
107
113
                        }
108
114
                }
109
 
                
110
 
                public bool IsValid (DebuggerSession session)
111
 
                {
112
 
                        if (store == null)
113
 
                                throw new InvalidOperationException ();
114
 
                        if (session == null)
115
 
                                return true;
116
 
                        return session.IsBreakEventValid (this);
117
 
                }
118
115
 
 
116
                /// <summary>
 
117
                /// Gets the status of the break event
 
118
                /// </summary>
 
119
                /// <returns>
 
120
                /// The status of the break event for the given debug session
 
121
                /// </returns>
 
122
                /// <param name='session'>
 
123
                /// Session for which to get the status of the break event
 
124
                /// </param>
 
125
                public BreakEventStatus GetStatus (DebuggerSession session)
 
126
                {
 
127
                        if (store == null || session == null)
 
128
                                return BreakEventStatus.Disconnected;
 
129
                        return session.GetBreakEventStatus (this);
 
130
                }
 
131
                
 
132
                /// <summary>
 
133
                /// Gets a message describing the status of the break event
 
134
                /// </summary>
 
135
                /// <returns>
 
136
                /// The status message of the break event for the given debug session
 
137
                /// </returns>
 
138
                /// <param name='session'>
 
139
                /// Session for which to get the status message of the break event
 
140
                /// </param>
 
141
                public string GetStatusMessage (DebuggerSession session)
 
142
                {
 
143
                        if (store == null || session == null)
 
144
                                return string.Empty;
 
145
                        return session.GetBreakEventStatusMessage (this);
 
146
                }
 
147
                
 
148
                /// <summary>
 
149
                /// Gets or sets the expression to be traced when the breakpoint is hit
 
150
                /// </summary>
 
151
                /// <remarks>
 
152
                /// If this break event is hit and the HitAction is TraceExpression, the debugger
 
153
                /// will evaluate and print the value of this property.
 
154
                /// The CommitChanges() method has to be called for changes in this
 
155
                /// property to take effect.
 
156
                /// </remarks>
119
157
                public string TraceExpression {
120
158
                        get {
121
159
                                return traceExpression;
125
163
                        }
126
164
                }
127
165
 
 
166
                /// <summary>
 
167
                /// Gets or sets the action to be performed when the breakpoint is hit
 
168
                /// </summary>
 
169
                /// <remarks>
 
170
                /// If the value is Break, the debugger will pause the execution.
 
171
                /// If the value is PrintExpression, the debugger will evaluate and
 
172
                /// print the value of the TraceExpression property.
 
173
                /// If the value is CustomAction, the debugger will execute the
 
174
                /// CustomBreakEventHitHandler callback specified in DebuggerSession,
 
175
                /// and will provide the value of CustomActionId as argument.
 
176
                /// The CommitChanges() method has to be called for changes in this
 
177
                /// property to take effect.
 
178
                /// </remarks>
128
179
                public HitAction HitAction {
129
180
                        get {
130
181
                                return hitAction;
133
184
                                hitAction = value;
134
185
                        }
135
186
                }
136
 
 
 
187
                
 
188
                /// <summary>
 
189
                /// Gets or sets the custom action identifier.
 
190
                /// </summary>
 
191
                /// <remarks>
 
192
                /// If this break event is hit and the value of HitAction is CustomAction,
 
193
                /// the debugger will execute the CustomBreakEventHitHandler callback
 
194
                /// specified in DebuggerSession, and will provide the value of this property
 
195
                /// as argument.
 
196
                /// The CommitChanges() method has to be called for changes in this
 
197
                /// property to take effect.
 
198
                /// </remarks>
137
199
                public string CustomActionId {
138
200
                        get {
139
201
                                return customActionId;
151
213
                                store = value;
152
214
                        }
153
215
                }
154
 
 
 
216
                
 
217
                /// <summary>
 
218
                /// Gets or sets the hit count.
 
219
                /// </summary>
 
220
                /// <remarks>
 
221
                /// When the break event is hit, if the value of this propery is greater than 0 then
 
222
                /// the value will be decremented and execution will be immediately resumed.
 
223
                /// The CommitChanges() method has to be called for changes in this
 
224
                /// property to take effect.
 
225
                /// </remarks>
155
226
                public int HitCount {
156
227
                        get {
157
228
                                return hitCount;
160
231
                                hitCount = value;
161
232
                        }
162
233
                }
163
 
 
 
234
                
 
235
                /// <summary>
 
236
                /// Gets the last value traced.
 
237
                /// </summary>
 
238
                /// <remarks>
 
239
                /// This property returns the last evaluation of TraceExpression.
 
240
                /// </remarks>
164
241
                public string LastTraceValue {
165
242
                        get {
166
243
                                return lastTraceValue;
170
247
                        }
171
248
                }
172
249
                
 
250
                /// <summary>
 
251
                /// Commits changes done in the break event properties
 
252
                /// </summary>
 
253
                /// <remarks>
 
254
                /// This method must be called after doing changes in the break event properties.
 
255
                /// </remarks>
173
256
                public void CommitChanges ()
174
257
                {
175
258
                        if (store != null)
182
265
                                store.NotifyBreakEventUpdated (this);
183
266
                }
184
267
                
 
268
                /// <summary>
 
269
                /// Clone this instance.
 
270
                /// </summary>
185
271
                public BreakEvent Clone ()
186
272
                {
187
273
                        return (BreakEvent) MemberwiseClone ();
188
274
                }
189
275
                
 
276
                /// <summary>
 
277
                /// Makes a copy of this instance
 
278
                /// </summary>
 
279
                /// <param name='ev'>
 
280
                /// A break event from which to copy the data.
 
281
                /// </param>
190
282
                public virtual void CopyFrom (BreakEvent ev)
191
283
                {
192
284
                        hitAction = ev.hitAction;