public boolean testAttribute(Object target, String name, String value) { if (target instanceof IJavaThread) { if (name.equals("TerminateEvaluationActionFilter") //$NON-NLS-1$ && value.equals("supportsTerminateEvaluation")) { //$NON-NLS-1$ IJavaThread thread = (IJavaThread) target; return thread.isPerformingEvaluation(); } else if (name.equals("ExcludeExceptionLocationFilter") //$NON-NLS-1$ && value.equals("suspendedAtException")) { //$NON-NLS-1$ IJavaThread thread = (IJavaThread) target; IBreakpoint[] breakpoints= thread.getBreakpoints(); for (int i = 0; i < breakpoints.length; i++) { IBreakpoint breakpoint= breakpoints[i]; try { if (breakpoint.isRegistered() && breakpoint instanceof IJavaExceptionBreakpoint) { return true; } } catch (CoreException e) { } } } } return false; } }
protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException { IJavaThread thread = (IJavaThread)element; if (!thread.isSuspended()) { return 0; } int childCount = thread.getFrameCount(); if (isDisplayMonitors()) { if (((IJavaDebugTarget) thread.getDebugTarget()).supportsMonitorInformation()) { childCount+= thread.getOwnedMonitors().length; if (thread.getContendedMonitor() != null) { childCount++; } } else { // unavailable notice childCount++; } } return childCount; }
/** * @see org.eclipse.debug.core.model.IDebugElement#getLaunch() */ public ILaunch getLaunch() { return fThread.getLaunch(); }
/** * Returns the number of children the given thread has in the view. * * @param thread thread * @return number of children */ protected int childCount(IThread thread) { try { IJavaThread jThread = (IJavaThread) thread; int count = jThread.getFrameCount(); if (isDisplayMonitors()) { if (((IJavaDebugTarget)thread.getDebugTarget()).supportsMonitorInformation()) { count += jThread.getOwnedMonitors().length; if (jThread.getContendedMonitor() != null) { count++; } } else { // make room for the 'no monitor info' element count++; } } return count; } catch (DebugException e) { } return -1; }
StringBuffer key = new StringBuffer("thread_"); //$NON-NLS-1$ String[] args = null; IBreakpoint[] breakpoints= thread.getBreakpoints(); if (thread.isDaemon()) { key.append("daemon_"); //$NON-NLS-1$ if (thread.isSystemThread()) { key.append("system_"); //$NON-NLS-1$ if (thread.isTerminated()) { key.append("terminated"); //$NON-NLS-1$ args = new String[] {thread.getName()}; } else if (thread.isStepping()) { key.append("stepping"); //$NON-NLS-1$ args = new String[] {thread.getName()}; } else if (thread.isPerformingEvaluation() && breakpoints.length == 0) { key.append("evaluating"); //$NON-NLS-1$ args = new String[] {thread.getName()}; } else if (!thread.isSuspended() || (thread instanceof JDIThread && ((JDIThread)thread).isSuspendedQuiet())) { key.append("running"); //$NON-NLS-1$ args = new String[] {thread.getName()}; } else { key.append("suspended"); //$NON-NLS-1$ IJavaStackFrame frame = (IJavaStackFrame)thread.getTopStackFrame(); IMarker problem = null; if (frame != null) { key.append("_problem"); //$NON-NLS-1$
return null; IJavaStackFrame f= (IJavaStackFrame)jt.getTopStackFrame(); if (f != null) { IJavaDebugTarget target = (IJavaDebugTarget) f.getDebugTarget(); IBreakpoint[] bps = jt.getBreakpoints(); && jt.getDebugTarget() == fVM) { } else if (e.getDetail() == DebugEvent.BREAKPOINT && bps.length > 0 && bps[0].equals(ScrapbookLauncher.getDefault().getMagicBreakpoint(jt.getDebugTarget()))) { IStackFrame[] frames = jt.getStackFrames(); for (int j = 0; j < frames.length; j++) { IJavaStackFrame frame = (IJavaStackFrame)frames[j];
thread = (IJavaThread) frame.getThread(); if (thread != null && (!thread.getDebugTarget().equals(target) || (!thread.isSuspended() && !thread.isPerformingEvaluation()))) {
/** * @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget() */ public IDebugTarget getDebugTarget() { return fThread.getDebugTarget(); }
protected int indexOf(IStackFrame frame) { if (isDisplayMonitors()) { if (((IJavaDebugTarget)frame.getDebugTarget()).supportsMonitorInformation()) { IJavaThread thread = (IJavaThread)frame.getThread(); int index = 0; try { index = thread.getOwnedMonitors().length; if (thread.getContendedMonitor() != null) { index++; } } catch (DebugException e) { } return index; } else { // make room for the 'no monitor info' element return 1; } } else { return super.indexOf(frame); } }
IJavaThread thread= (IJavaThread)itr.next(); try { IBreakpoint[] breakpoints= thread.getBreakpoints(); IJavaStackFrame frame= (IJavaStackFrame)thread.getTopStackFrame(); String newFilter= frame.getDeclaringTypeName(); int index = newFilter.indexOf(Signature.C_GENERIC_START);
protected Object[] getChildren(IJavaThread thread) { try { IStackFrame[] frames = thread.getStackFrames(); if (!isDisplayMonitors()) { return frames; if (((IJavaDebugTarget) thread.getDebugTarget()).supportsMonitorInformation()) { IDebugElement[] ownedMonitors = JavaDebugUtils.getOwnedMonitors(thread); IDebugElement contendedMonitor = JavaDebugUtils.getContendedMonitor(thread); children[0] = new NoMonitorInformationElement(thread.getDebugTarget());
protected boolean handlesEvent(DebugEvent event) { if (super.handlesEvent(event)) { Object source = event.getSource(); if (source instanceof IJavaThread) { IJavaThread thread = (IJavaThread) source; ILaunch launch = thread.getLaunch(); if (launch != null) { if (launch.getAttribute(ScrapbookLauncher.SCRAPBOOK_LAUNCH) != null) { if (event.getKind() == DebugEvent.SUSPEND) { try { IJavaStackFrame frame = (IJavaStackFrame) thread.getTopStackFrame(); if (frame.getDeclaringTypeName().startsWith("org.eclipse.jdt.internal.debug.ui.snippeteditor.ScrapbookMain")) { //$NON-NLS-1$ return false; } } catch (DebugException e) { } } } } } } else { return false; } return true; }
/** * Performs the step. */ public void step() { // add event filter and turn off step filters DebugPlugin.getDefault().addDebugEventFilter(this); fStepFilterEnabledState = getDebugTarget().isStepFiltersEnabled(); getDebugTarget().setStepFiltersEnabled(false); try { fOriginalStackDepth = getThread().getStackFrames().length; setExpectedEvent(DebugEvent.RESUME, DebugEvent.STEP_INTO); getThread().stepInto(); } catch (DebugException e) { JDIDebugUIPlugin.log(e); cleanup(); DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[]{new DebugEvent(getDebugTarget(), DebugEvent.CHANGE)}); } }
protected int indexOf(IThread thread) { if (JavaElementContentProvider.isDisplayThreadGroups()) { IJavaThread javaThread = (IJavaThread) thread; try { return indexOf(javaThread.getThreadGroup().getThreads(), javaThread); } catch (CoreException e) { return -1; } } return super.indexOf(thread); }
/** * @see org.eclipse.debug.core.model.IDebugElement#getModelIdentifier() */ public String getModelIdentifier() { return fThread.getModelIdentifier(); }
/** * @see IStatusHandler#handleStatus(IStatus, Object) */ public Object handleStatus(IStatus status, Object source) throws CoreException { IJavaThread thread= (IJavaThread) source; final ErrorDialog dialog= new ErrorDialog(JDIDebugUIPlugin.getActiveWorkbenchShell(), DebugUIMessages.SuspendTimeoutHandler_suspend, MessageFormat.format(DebugUIMessages.SuspendTimeoutHandler_timeout_occurred, new String[] {thread.getName()}), status, IStatus.WARNING | IStatus.ERROR | IStatus.INFO); // Display display= JDIDebugUIPlugin.getStandardDisplay(); display.syncExec(new Runnable() { public void run() { dialog.open(); } }); return null; } }
protected IJavaDebugTarget getDebugTarget() { return (IJavaDebugTarget)getThread().getDebugTarget(); }
IJavaObject contendedMonitor= fThread.getContendedMonitor(); if (contendedMonitor == null) { changed= fContendedMonitor != null; IJavaObject[] ownedMonitors= fThread.getOwnedMonitors(); if (ownedMonitors == null || ownedMonitors.length == 0) {
IJavaThread thread = (IJavaThread)frame.getThread(); try { if (frame.equals(thread.getTopStackFrame())) { IBreakpoint[] breakpoints = thread.getBreakpoints(); if (breakpoints.length == 1) { if (breakpoints[0] instanceof IJavaExceptionBreakpoint) {
delta = delta.addNode(debugTarget, indexOf(launchChildren, debugTarget), IModelDelta.NO_CHANGE, debugTarget.getRootThreadGroups().length); IJavaThread javaThread = (IJavaThread) thread; IJavaThreadGroup threadGroup = javaThread.getThreadGroup(); while (threadGroup != null) { groups.add(0, threadGroup);