use of org.eclipse.jdt.internal.debug.core.model.JDIThread in project liferay-ide by liferay.
the class FMDebugTarget method suspendRelatedJavaThread.
boolean suspendRelatedJavaThread(final long remoteThreadId) throws DebugException {
boolean retval = false;
for (IDebugTarget target : this.launch.getDebugTargets()) {
if (target instanceof IJavaDebugTarget) {
IJavaDebugTarget javaTarget = (IJavaDebugTarget) target;
IThread[] threads = javaTarget.getThreads();
for (final IThread thread : threads) {
if (thread instanceof JDIThread) {
JDIThread jdiThread = (JDIThread) thread;
ThreadReference underlyingThread = jdiThread.getUnderlyingThread();
Field tidField = underlyingThread.referenceType().fieldByName("tid");
Value tidValue = underlyingThread.getValue(tidField);
long threadId = Long.parseLong(tidValue.toString());
if (threadId == remoteThreadId) {
thread.suspend();
break;
}
}
}
}
}
return retval;
}
Aggregations