use of org.eclipse.debug.core.model.IThread in project liferay-ide by liferay.
the class PortalSourceLookupParticipant method getTemplateName.
private String getTemplateName(IStackFrame frame) throws DebugException {
String retval = null;
IThread thread = frame.getThread();
IBreakpoint[] bps = thread.getBreakpoints();
if (bps.length == 1) {
IBreakpoint bp = thread.getBreakpoints()[0];
retval = bp.getMarker().getAttribute(ILRDebugConstants.FM_TEMPLATE_NAME, null);
} else {
if (thread instanceof FMThread) {
FMThread fmThread = (FMThread) thread;
Breakpoint stepBp = fmThread.getStepBreakpoint();
if (stepBp != null) {
// $NON-NLS-1$
retval = stepBp.getTemplateName().replaceAll(FMDebugTarget.FM_TEMPLATE_SERVLET_CONTEXT, "");
}
}
}
return retval;
}
use of org.eclipse.debug.core.model.IThread 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