Пример #1
0
        internal JvmEventManager(JvmEnvironment environment)
        {
            Contract.Requires <ArgumentNullException>(environment != null, "environment");

            _environment = environment;

            _eventCallbacks                         = new jvmtiEventCallbacks();
            _eventCallbacks.VMInit                  = HandleVMInit;
            _eventCallbacks.VMDeath                 = HandleVMDeath;
            _eventCallbacks.ThreadStart             = HandleThreadStart;
            _eventCallbacks.ThreadEnd               = HandleThreadEnd;
            _eventCallbacks.ClassFileLoadHook       = HandleClassFileLoadHook;
            _eventCallbacks.ClassLoad               = HandleClassLoad;
            _eventCallbacks.ClassPrepare            = HandleClassPrepare;
            _eventCallbacks.VMStart                 = HandleVMStart;
            _eventCallbacks.Exception               = HandleException;
            _eventCallbacks.ExceptionCatch          = HandleExceptionCatch;
            _eventCallbacks.SingleStep              = HandleSingleStep;
            _eventCallbacks.FramePop                = HandleFramePop;
            _eventCallbacks.Breakpoint              = HandleBreakpoint;
            _eventCallbacks.FieldAccess             = HandleFieldAccess;
            _eventCallbacks.FieldModification       = HandleFieldModification;
            _eventCallbacks.MethodEntry             = HandleMethodEntry;
            _eventCallbacks.MethodExit              = HandleMethodExit;
            _eventCallbacks.NativeMethodBind        = HandleNativeMethodBind;
            _eventCallbacks.CompiledMethodLoad      = HandleCompiledMethodLoad;
            _eventCallbacks.CompiledMethodUnload    = HandleCompiledMethodUnload;
            _eventCallbacks.DynamicCodeGenerated    = HandleDynamicCodeGenerated;
            _eventCallbacks.DataDumpRequest         = HandleDataDumpRequest;
            _eventCallbacks.MonitorWait             = HandleMonitorWait;
            _eventCallbacks.MonitorWaited           = HandleMonitorWaited;
            _eventCallbacks.MonitorContendedEnter   = HandleMonitorContendedEnter;
            _eventCallbacks.MonitorContendedEntered = HandleMonitorContendedEntered;
            _eventCallbacks.ResourceExhausted       = HandleResourceExhausted;
            _eventCallbacks.GarbageCollectionStart  = HandleGarbageCollectionStart;
            _eventCallbacks.GarbageCollectionFinish = HandleGarbageCollectionFinish;
            _eventCallbacks.ObjectFree              = HandleObjectFree;
            _eventCallbacks.VMObjectAlloc           = HandleVMObjectAlloc;
        }
Пример #2
0
        internal void SetEventCallbacks(jvmtiEventCallbacks callbacks)
        {
            int sizeOfCallbacks = Marshal.SizeOf(callbacks);

            ThrowOnFailure(_rawInterface.SetEventCallbacks(_env, ref callbacks, sizeOfCallbacks));
        }