Skip to content
This repository was archived by the owner on Oct 4, 2021. It is now read-only.

Commit daeb98d

Browse files
iain holmesmonojenkins
authored andcommitted
[Debugger] Can't edit function breakpoint
Enable editing of breakpoint locations, either line, function or exception Fixes VSTS #528267
1 parent d02f67c commit daeb98d

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BreakpointPropertiesDialog.cs

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,12 @@ void SaveFunctionBreakpoint (FunctionBreakpoint fb)
364364
fb.ParamTypes = parsedParamTypes;
365365
}
366366

367+
void SaveCatchpoint (Catchpoint cp)
368+
{
369+
cp.ExceptionName = entryExceptionType.Text;
370+
cp.IncludeSubclasses = checkIncludeSubclass.Active;
371+
}
372+
367373
class ParsedLocation
368374
{
369375
int line;
@@ -461,14 +467,17 @@ void SaveBreakpoint (Breakpoint bp)
461467

462468
void OnSave (object sender, EventArgs e)
463469
{
470+
bool catchpointSaved = false;
471+
464472
if (be == null) {
465473
if (stopOnFunction.Active)
466474
be = new FunctionBreakpoint ("", "C#");
467475
else if (stopOnLocation.Active)
468476
be = breakpointLocation.ToBreakpoint ();
469-
else if (stopOnException.Active)
477+
else if (stopOnException.Active) {
470478
be = new Catchpoint (entryExceptionType.Text, checkIncludeSubclass.Active);
471-
else
479+
catchpointSaved = true;
480+
} else
472481
return;
473482
}
474483

@@ -480,6 +489,13 @@ void OnSave (object sender, EventArgs e)
480489
if (bp != null)
481490
SaveBreakpoint (bp);
482491

492+
if (!catchpointSaved) {
493+
var cp = be as Catchpoint;
494+
if (cp != null) {
495+
SaveCatchpoint (cp);
496+
}
497+
}
498+
483499
if ((HitCountMode)ignoreHitType.SelectedItem == HitCountMode.GreaterThanOrEqualTo && (int)ignoreHitCount.Value == 0) {
484500
be.HitCountMode = HitCountMode.None;
485501
} else {
@@ -518,10 +534,11 @@ void OnUpdateControls (object sender, EventArgs e)
518534
}
519535

520536
// Check which radio is selected.
521-
hboxFunction.Sensitive = stopOnFunction.Active && DebuggingService.IsFeatureSupported (DebuggerFeatures.Breakpoints) && !editing;
522-
hboxLocation.Sensitive = stopOnLocation.Active && DebuggingService.IsFeatureSupported (DebuggerFeatures.Breakpoints) && !editing;
523-
hboxException.Sensitive = stopOnException.Active && DebuggingService.IsFeatureSupported (DebuggerFeatures.Catchpoints) && !editing;
524-
checkIncludeSubclass.Sensitive = stopOnException.Active && !editing;
537+
var connected = DebuggingService.DebuggerSession != null ? DebuggingService.DebuggerSession.IsConnected : false;
538+
hboxFunction.Sensitive = stopOnFunction.Active && DebuggingService.IsFeatureSupported (DebuggerFeatures.Breakpoints) && !connected;
539+
hboxLocation.Sensitive = stopOnLocation.Active && DebuggingService.IsFeatureSupported (DebuggerFeatures.Breakpoints) && !connected;
540+
hboxException.Sensitive = stopOnException.Active && DebuggingService.IsFeatureSupported (DebuggerFeatures.Catchpoints) && !connected;
541+
checkIncludeSubclass.Sensitive = stopOnException.Active;
525542
hboxCondition.Sensitive = DebuggingService.IsFeatureSupported (DebuggerFeatures.ConditionalBreakpoints);
526543

527544
// Check printing an expression.

0 commit comments

Comments
 (0)