Added tests for Task.WhenAll w/ empty list
[mono.git] / mcs / class / Mono.Debugger.Soft / Mono.Debugger.Soft / ExceptionEventRequest.cs
1 using System;
2 using System.Collections.Generic;
3
4 namespace Mono.Debugger.Soft
5 {
6         public sealed class ExceptionEventRequest : EventRequest {
7
8                 TypeMirror exc_type;
9                 bool caught, uncaught;
10                 
11                 internal ExceptionEventRequest (VirtualMachine vm, TypeMirror exc_type, bool caught, bool uncaught) : base (vm, EventType.Exception) {
12                         if (exc_type != null) {
13                                 CheckMirror (vm, exc_type);
14                                 TypeMirror exception_type = vm.RootDomain.Corlib.GetType ("System.Exception", false, false);
15                                 if (!exception_type.IsAssignableFrom (exc_type))
16                                         throw new ArgumentException ("The exception type does not inherit from System.Exception", "exc_type");
17                         }
18                         this.exc_type = exc_type;
19                         this.caught = caught;
20                         this.uncaught = uncaught;
21                 }
22
23                 public TypeMirror ExceptionType {
24                         get {
25                                 return exc_type;
26                         }
27                 }
28
29                 public override void Enable () {
30                         var mods = new List <Modifier> ();
31                         mods.Add (new ExceptionModifier () { Type = exc_type != null ? exc_type.Id : 0, Caught = caught, Uncaught = uncaught });
32                         SendReq (mods);
33                 }
34         }
35 }