public JvmThreadReference GetCurrentThread(JNIEnvHandle jniEnv) { jthread threadHandle; ThrowOnFailure(_rawInterface.GetCurrentThread(_env, out threadHandle)); return(JvmThreadReference.FromHandle(this, jniEnv, threadHandle, true)); }
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); } }
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); } }
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); } }
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); } }
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); } }
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); } }
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); } }
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); } }
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); } }
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); } }
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); } }
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); } }