public void Events(SuspendPolicy suspend_policy, EventInfo[] events) { var l = new List <Event> (); for (int i = 0; i < events.Length; ++i) { EventInfo ei = events [i]; int req_id = ei.ReqId; long thread_id = ei.ThreadId; long id = ei.Id; long loc = ei.Location; switch (ei.EventType) { case EventType.VMStart: vm.notify_vm_event(EventType.VMStart, suspend_policy, req_id, thread_id, null, 0); break; case EventType.VMDeath: vm.notify_vm_event(EventType.VMDeath, suspend_policy, req_id, thread_id, null, ei.ExitCode); break; case EventType.ThreadStart: vm.InvalidateThreadCache(); l.Add(new ThreadStartEvent(vm, req_id, id)); break; case EventType.ThreadDeath: // Avoid calling GetThread () since it might call into the debuggee // and we can't do that in the event handler var thread = vm.TryGetThread(id); if (thread != null) { thread.InvalidateFrames(); } vm.InvalidateThreadCache(); l.Add(new ThreadDeathEvent(vm, req_id, id)); break; case EventType.AssemblyLoad: vm.InvalidateAssemblyCaches(); l.Add(new AssemblyLoadEvent(vm, req_id, thread_id, id)); break; case EventType.AssemblyUnload: vm.InvalidateAssemblyCaches(); l.Add(new AssemblyUnloadEvent(vm, req_id, thread_id, id)); break; case EventType.TypeLoad: l.Add(new TypeLoadEvent(vm, req_id, thread_id, id)); break; case EventType.MethodEntry: l.Add(new MethodEntryEvent(vm, req_id, thread_id, id)); break; case EventType.MethodExit: l.Add(new MethodExitEvent(vm, req_id, thread_id, id)); break; case EventType.Breakpoint: l.Add(new BreakpointEvent(vm, req_id, thread_id, id, loc)); break; case EventType.Step: l.Add(new StepEvent(vm, req_id, thread_id, id, loc)); break; case EventType.Exception: l.Add(new ExceptionEvent(vm, req_id, thread_id, id, loc)); break; case EventType.AppDomainCreate: l.Add(new AppDomainCreateEvent(vm, req_id, thread_id, id)); break; case EventType.AppDomainUnload: l.Add(new AppDomainUnloadEvent(vm, req_id, thread_id, id)); break; case EventType.UserBreak: l.Add(new UserBreakEvent(vm, req_id, thread_id)); break; case EventType.UserLog: l.Add(new UserLogEvent(vm, req_id, thread_id, ei.Level, ei.Category, ei.Message)); break; case EventType.Crash: l.Add(new CrashEvent(vm, req_id, thread_id, ei.Dump, ei.Hash)); break; } } if (l.Count > 0) { vm.queue_event_set(new EventSet(vm, suspend_policy, l.ToArray())); } }
public void Events(SuspendPolicy suspend_policy, EventInfo[] events) { var l = new List <Event> (); for (int i = 0; i < events.Length; ++i) { EventInfo ei = events [i]; int req_id = ei.ReqId; long thread_id = ei.ThreadId; long id = ei.Id; long loc = ei.Location; switch (ei.EventType) { case EventType.VMStart: vm.notify_vm_event(EventType.VMStart, suspend_policy, req_id, thread_id, null, 0); break; case EventType.VMDeath: vm.notify_vm_event(EventType.VMDeath, suspend_policy, req_id, thread_id, null, ei.ExitCode); break; case EventType.ThreadStart: vm.InvalidateThreadCache(); l.Add(new ThreadStartEvent(vm, req_id, id)); break; case EventType.ThreadDeath: vm.InvalidateThreadCache(); l.Add(new ThreadDeathEvent(vm, req_id, id)); break; case EventType.AssemblyLoad: vm.InvalidateAssemblyCaches(); l.Add(new AssemblyLoadEvent(vm, req_id, thread_id, id)); break; case EventType.AssemblyUnload: vm.InvalidateAssemblyCaches(); l.Add(new AssemblyUnloadEvent(vm, req_id, thread_id, id)); break; case EventType.TypeLoad: l.Add(new TypeLoadEvent(vm, req_id, thread_id, id)); break; case EventType.MethodEntry: l.Add(new MethodEntryEvent(vm, req_id, thread_id, id)); break; case EventType.MethodExit: l.Add(new MethodExitEvent(vm, req_id, thread_id, id)); break; case EventType.Breakpoint: l.Add(new BreakpointEvent(vm, req_id, thread_id, id, loc)); break; case EventType.Step: l.Add(new StepEvent(vm, req_id, thread_id, id, loc)); break; case EventType.Exception: l.Add(new ExceptionEvent(vm, req_id, thread_id, id, loc)); break; case EventType.AppDomainCreate: l.Add(new AppDomainCreateEvent(vm, req_id, thread_id, id)); break; case EventType.AppDomainUnload: l.Add(new AppDomainUnloadEvent(vm, req_id, thread_id, id)); break; case EventType.UserBreak: l.Add(new UserBreakEvent(vm, req_id, thread_id)); break; case EventType.UserLog: l.Add(new UserLogEvent(vm, req_id, thread_id, ei.Level, ei.Category, ei.Message)); break; } } if (l.Count > 0) { vm.queue_event_set(new EventSet(vm, suspend_policy, l.ToArray())); } }