示例#1
0
        public JvmThreadReference GetCurrentThread(JNIEnvHandle jniEnv)
        {
            jthread threadHandle;

            ThrowOnFailure(_rawInterface.GetCurrentThread(_env, out threadHandle));
            return(JvmThreadReference.FromHandle(this, jniEnv, threadHandle, true));
        }
示例#2
0
        private void HandleThreadEnd(jvmtiEnvHandle env, JNIEnvHandle jniEnv, jthread threadHandle)
        {
            JvmEnvironment     environment = JvmEnvironment.GetEnvironment(env);
            JvmThreadReference thread      = JvmThreadReference.FromHandle(environment, jniEnv, threadHandle, true);

            foreach (var processor in _processors)
            {
                processor.HandleThreadEnd(environment, thread);
            }
        }
示例#3
0
        private void HandleMonitorContendedEntered(jvmtiEnvHandle env, JNIEnvHandle jniEnv, jthread threadHandle, jobject objectHandle)
        {
            JvmEnvironment     environment = JvmEnvironment.GetEnvironment(env);
            JvmThreadReference thread      = JvmThreadReference.FromHandle(environment, jniEnv, threadHandle, true);
            JvmObjectReference @object     = JvmObjectReference.FromHandle(environment, jniEnv, objectHandle, true);

            foreach (var processor in _processors)
            {
                processor.HandleMonitorContendedEntered(environment, thread, @object);
            }
        }
示例#4
0
        private void HandleMonitorWait(jvmtiEnvHandle env, JNIEnvHandle jniEnv, jthread threadHandle, jobject objectHandle, long millisecondsTimeout)
        {
            JvmEnvironment     environment = JvmEnvironment.GetEnvironment(env);
            JvmThreadReference thread      = JvmThreadReference.FromHandle(environment, jniEnv, threadHandle, true);
            JvmObjectReference @object     = JvmObjectReference.FromHandle(environment, jniEnv, objectHandle, true);

            foreach (var processor in _processors)
            {
                processor.HandleMonitorWait(environment, thread, @object, millisecondsTimeout);
            }
        }
示例#5
0
        private void HandleMethodExit(jvmtiEnvHandle env, JNIEnvHandle jniEnv, jthread threadHandle, jmethodID methodId, bool wasPoppedByException, jvalue returnValue)
        {
            JvmEnvironment     environment = JvmEnvironment.GetEnvironment(env);
            JvmThreadReference thread      = JvmThreadReference.FromHandle(environment, jniEnv, threadHandle, true);
            JvmMethod          method      = new JvmMethod(environment, methodId);

            foreach (var processor in _processors)
            {
                processor.HandleMethodExit(environment, thread, method, wasPoppedByException, returnValue);
            }
        }
示例#6
0
        private void HandleMethodEntry(jvmtiEnvHandle env, JNIEnvHandle jniEnv, jthread threadHandle, jmethodID methodId)
        {
            JvmEnvironment     environment = JvmEnvironment.GetEnvironment(env);
            JvmThreadReference thread      = JvmThreadReference.FromHandle(environment, jniEnv, threadHandle, true);
            JvmMethod          method      = new JvmMethod(environment, methodId);

            foreach (var processor in _processors)
            {
                processor.HandleMethodEntry(environment, thread, method);
            }
        }
示例#7
0
        private void HandleBreakpoint(jvmtiEnvHandle env, JNIEnvHandle jniEnv, jthread threadHandle, jmethodID method, jlocation jlocation)
        {
            JvmEnvironment     environment = JvmEnvironment.GetEnvironment(env);
            JvmThreadReference thread      = JvmThreadReference.FromHandle(environment, jniEnv, threadHandle, true);
            JvmLocation        location    = new JvmLocation(environment, method, jlocation);

            foreach (var processor in _processors)
            {
                processor.HandleBreakpoint(environment, thread, location);
            }
        }
示例#8
0
        private void HandleClassLoad(jvmtiEnvHandle env, JNIEnvHandle jniEnv, jthread threadHandle, jclass classHandle)
        {
            JvmEnvironment     environment = JvmEnvironment.GetEnvironment(env);
            JvmThreadReference thread      = JvmThreadReference.FromHandle(environment, jniEnv, threadHandle, true);
            JvmClassReference  @class      = JvmClassReference.FromHandle(environment, jniEnv, classHandle, true);

            foreach (var processor in _processors)
            {
                processor.HandleClassLoad(environment, thread, @class);
            }
        }
示例#9
0
        private void HandleVMObjectAlloc(jvmtiEnvHandle env, JNIEnvHandle jniEnv, jthread threadHandle, jobject objectHandle, jclass objectClassHandle, long size)
        {
            JvmEnvironment     environment = JvmEnvironment.GetEnvironment(env);
            JvmThreadReference thread      = JvmThreadReference.FromHandle(environment, jniEnv, threadHandle, true);
            JvmObjectReference @object     = JvmObjectReference.FromHandle(environment, jniEnv, objectHandle, true);
            JvmClassReference  objectClass = JvmClassReference.FromHandle(environment, jniEnv, objectClassHandle, true);

            foreach (var processor in _processors)
            {
                processor.HandleVMObjectAllocation(environment, thread, @object, objectClass, size);
            }
        }
示例#10
0
        private void HandleNativeMethodBind(jvmtiEnvHandle env, JNIEnvHandle jniEnv, jthread threadHandle, jmethodID methodId, IntPtr address, ref IntPtr newAddressPtr)
        {
            JvmEnvironment     environment = JvmEnvironment.GetEnvironment(env);
            JvmThreadReference thread      = JvmThreadReference.FromHandle(environment, jniEnv, threadHandle, true);
            JvmMethod          method      = new JvmMethod(environment, methodId);

            foreach (var processor in _processors)
            {
                IntPtr?newAddress = null;
                processor.HandleNativeMethodBind(environment, thread, method, address, ref newAddress);
            }
        }
示例#11
0
        private void HandleExceptionCatch(jvmtiEnvHandle env, JNIEnvHandle jniEnv, jthread threadHandle, jmethodID method, jlocation jlocation, jobject exceptionHandle)
        {
            JvmEnvironment     environment = JvmEnvironment.GetEnvironment(env);
            JvmThreadReference thread      = JvmThreadReference.FromHandle(environment, jniEnv, threadHandle, true);
            JvmLocation        location    = new JvmLocation(environment, method, jlocation);
            JvmObjectReference exception   = JvmObjectReference.FromHandle(environment, jniEnv, exceptionHandle, true);

            foreach (var processor in _processors)
            {
                processor.HandleExceptionCatch(environment, thread, location, exception);
            }
        }
示例#12
0
        private void HandleVMInit(jvmtiEnvHandle env, JNIEnvHandle jniEnv, jthread threadHandle)
        {
            JvmEnvironment     environment = JvmEnvironment.GetEnvironment(env);
            JvmThreadReference thread      = JvmThreadReference.FromHandle(environment, jniEnv, threadHandle, true);

            jvmtiError result = environment.RawInterface.RunAgentThread(env, alloc_thread(jniEnv), DispatchJvmEvents, IntPtr.Zero, JvmThreadPriority.Maximum);

            foreach (var processor in _processors)
            {
                processor.HandleVMInitialization(environment, thread);
            }
        }
示例#13
0
        private void HandleFieldModification(jvmtiEnvHandle env, JNIEnvHandle jniEnv, jthread threadHandle, jmethodID method, jlocation jlocation, jclass fieldClassHandle, jobject @objectHandle, jfieldID fieldId, byte signatureType, jvalue newValue)
        {
            JvmEnvironment     environment = JvmEnvironment.GetEnvironment(env);
            JvmThreadReference thread      = JvmThreadReference.FromHandle(environment, jniEnv, threadHandle, true);
            JvmLocation        location    = new JvmLocation(environment, method, jlocation);
            JvmClassReference  fieldClass  = JvmClassReference.FromHandle(environment, jniEnv, fieldClassHandle, true);
            JvmObjectReference @object     = JvmObjectReference.FromHandle(environment, jniEnv, objectHandle, true);
            JvmField           field       = new JvmField(environment, fieldId);

            foreach (var processor in _processors)
            {
                processor.HandleFieldModification(environment, thread, location, fieldClass, @object, field, signatureType, newValue);
            }
        }