@@ -364,6 +364,12 @@ void SaveFunctionBreakpoint (FunctionBreakpoint fb)
364
364
fb . ParamTypes = parsedParamTypes ;
365
365
}
366
366
367
+ void SaveCatchpoint ( Catchpoint cp )
368
+ {
369
+ cp . ExceptionName = entryExceptionType . Text ;
370
+ cp . IncludeSubclasses = checkIncludeSubclass . Active ;
371
+ }
372
+
367
373
class ParsedLocation
368
374
{
369
375
int line ;
@@ -461,14 +467,17 @@ void SaveBreakpoint (Breakpoint bp)
461
467
462
468
void OnSave ( object sender , EventArgs e )
463
469
{
470
+ bool catchpointSaved = false ;
471
+
464
472
if ( be == null ) {
465
473
if ( stopOnFunction . Active )
466
474
be = new FunctionBreakpoint ( "" , "C#" ) ;
467
475
else if ( stopOnLocation . Active )
468
476
be = breakpointLocation . ToBreakpoint ( ) ;
469
- else if ( stopOnException . Active )
477
+ else if ( stopOnException . Active ) {
470
478
be = new Catchpoint ( entryExceptionType . Text , checkIncludeSubclass . Active ) ;
471
- else
479
+ catchpointSaved = true ;
480
+ } else
472
481
return ;
473
482
}
474
483
@@ -480,6 +489,13 @@ void OnSave (object sender, EventArgs e)
480
489
if ( bp != null )
481
490
SaveBreakpoint ( bp ) ;
482
491
492
+ if ( ! catchpointSaved ) {
493
+ var cp = be as Catchpoint ;
494
+ if ( cp != null ) {
495
+ SaveCatchpoint ( cp ) ;
496
+ }
497
+ }
498
+
483
499
if ( ( HitCountMode ) ignoreHitType . SelectedItem == HitCountMode . GreaterThanOrEqualTo && ( int ) ignoreHitCount . Value == 0 ) {
484
500
be . HitCountMode = HitCountMode . None ;
485
501
} else {
@@ -518,10 +534,11 @@ void OnUpdateControls (object sender, EventArgs e)
518
534
}
519
535
520
536
// 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 ;
525
542
hboxCondition . Sensitive = DebuggingService . IsFeatureSupported ( DebuggerFeatures . ConditionalBreakpoints ) ;
526
543
527
544
// Check printing an expression.
0 commit comments