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

Commit 52a5a0e

Browse files
authored
Merge pull request #3698 from mono/fix-528267
[Debugger] Can't edit function breakpoint
2 parents 93cd833 + 9481bff commit 52a5a0e

File tree

2 files changed

+29
-7
lines changed

2 files changed

+29
-7
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,12 @@ protected void OnProperties ()
218218
}
219219
}
220220

221+
[CommandUpdateHandler (LocalCommands.Properties)]
222+
protected void OnUpdateProperties (CommandInfo info)
223+
{
224+
info.Enabled = !DebuggingService.IsDebugging && tree.Selection.CountSelectedRows () == 1 ;
225+
}
226+
221227
string GetIconId (BreakEvent bp)
222228
{
223229
if (bp is Catchpoint)
@@ -323,7 +329,6 @@ protected void OnDeleted ()
323329
}
324330

325331
[CommandUpdateHandler (LocalCommands.GoToFile)]
326-
[CommandUpdateHandler (LocalCommands.Properties)]
327332
protected void UpdateBpCommand (CommandInfo cmd)
328333
{
329334
cmd.Enabled = tree.Selection.CountSelectedRows () == 1;

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)