public DisposableObjectCollection <JvmObjectReference> GetOwnedMonitorInfo(JvmThreadReference thread, JvmNativeEnvironment nativeEnvironment) { DisposableObjectCollection <JvmObjectReference> result = new DisposableObjectCollection <JvmObjectReference>(); int ownedMonitorCount; IntPtr ownedMonitors; ThrowOnFailure(_rawInterface.GetOwnedMonitorInfo(_env, (jthread)thread, out ownedMonitorCount, out ownedMonitors)); try { unsafe { jobject *rawMonitors = (jobject *)ownedMonitors; for (int i = 0; i < ownedMonitorCount; i++) { result.Add(new JvmObjectReference(this, nativeEnvironment, rawMonitors[i], true)); } } return(result); } finally { if (ownedMonitors != IntPtr.Zero) { Deallocate(ownedMonitors); } } }
public JvmThreadReference GetCurrentThread(JNIEnvHandle jniEnv) { jthread threadHandle; ThrowOnFailure(_rawInterface.GetCurrentThread(_env, out threadHandle)); return(JvmThreadReference.FromHandle(this, jniEnv, threadHandle, true)); }
public IntPtr GetThreadLocalStorage(JvmThreadReference thread) { IntPtr data; ThrowOnFailure(_rawInterface.GetThreadLocalStorage(_env, (jthread)thread, out data)); return(data); }
internal jvmtiThreadState GetThreadState(JvmThreadReference thread) { jvmtiThreadState threadState; ThrowOnFailure(_rawInterface.GetThreadState(_env, (jthread)thread, out threadState)); return(threadState); }
internal JvmThreadInfo GetThreadInfo(JvmThreadReference thread, JNIEnvHandle jniEnv) { jvmtiThreadInfo info; ThrowOnFailure(_rawInterface.GetThreadInfo(_env, (jthread)thread, out info)); return(new JvmThreadInfo(this, jniEnv, info, true)); }
protected virtual void Dispose(bool disposing) { JvmThreadReference thread = _thread; if (thread != null) { thread.Dispose(); } }
internal JvmStackInfo(JvmThreadReference thread, jvmtiThreadState state, ReadOnlyCollection <JvmLocation> frames) { Contract.Requires <ArgumentNullException>(thread != null, "thread"); Contract.Requires <ArgumentNullException>(frames != null, "frames"); _thread = thread; _state = state; _frames = frames; }
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 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 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 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); } }
public void SetEventNotificationMode(JvmEventMode mode, JvmEventType eventType, JvmThreadReference eventThread) { jthread eventThreadHandle = (jthread)eventThread; ThrowOnFailure(_rawInterface.SetEventNotificationMode(_env, mode, eventType, eventThreadHandle)); }
public void NotifyFramePop(JvmThreadReference thread, int depth) { throw new NotImplementedException(); }
public JvmLocation GetFrameLocation(JvmThreadReference thread, int depth) { throw new NotImplementedException(); }
public void PopFrame(JvmThreadReference thread) { throw new NotImplementedException(); }
public int GetFrameCount(JvmThreadReference thread) { throw new NotImplementedException(); }
public IList <JvmLocation> GetStackTrace(JvmThreadReference thread, int startDepth, int maxFrameCount) { throw new NotImplementedException(); }
public void SetThreadLocalStorage(JvmThreadReference thread, IntPtr data) { ThrowOnFailure(_rawInterface.SetThreadLocalStorage(_env, (jthread)thread, data)); }
internal void RunAgentThread(JvmThreadReference thread, UnsafeNativeMethods.jvmtiStartFunction proc, IntPtr arg, int priority) { throw new NotImplementedException(); }
public JvmObjectReference GetCurrentContendedMonitor(JvmThreadReference thread) { throw new NotImplementedException(); }
public DisposableObjectCollection <JvmMonitorInfo> GetOwnedMonitorStackDepthInfo(JvmThreadReference thread) { throw new NotImplementedException(); }
public void InterruptThread(JvmThreadReference thread) { throw new NotImplementedException(); }