2010-04-06 Jb Evain <jbevain@novell.com>
[mcs.git] / class / Mono.Debugger.Soft / Mono.Debugger.Soft / ExceptionEventRequest.cs
blob07d4d8ccdd054125d6037c4ff899f9435e7cb89f
1 using System;
2 using System.Collections.Generic;
4 namespace Mono.Debugger.Soft
6 public sealed class ExceptionEventRequest : EventRequest {
8 TypeMirror exc_type;
9 bool caught, uncaught;
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");
18 this.exc_type = exc_type;
19 this.caught = caught;
20 this.uncaught = uncaught;
23 public TypeMirror ExceptionType {
24 get {
25 return exc_type;
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);