/** * Notifies the given target of the given breakpoint * addition or removal. * * @param target Java debug target * @param breakpoint a breakpoint * @param kind ADDED, REMOVED, or CHANGED */ protected void notifyTarget(IJavaDebugTarget target, IBreakpoint breakpoint, int kind) { switch (kind) { case ADDED: target.breakpointAdded(breakpoint); break; case REMOVED: target.breakpointRemoved(breakpoint,null); break; case CHANGED: target.breakpointChanged(breakpoint,null); break; } }
/** * Build the text for an IJavaDebugTarget. */ protected String getDebugTargetText(IJavaDebugTarget debugTarget) throws DebugException { String labelString= debugTarget.getName(); if (debugTarget.isSuspended()) { labelString += DebugUIMessages.JDIModelPresentation_target_suspended; } return labelString; }
protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException { if (IDebugUIConstants.ID_DEBUG_VIEW.equals(context.getId())) { if (JavaElementContentProvider.isDisplayThreadGroups()) { IJavaDebugTarget debugTarget = (IJavaDebugTarget)element; if (debugTarget.isDisconnected() || debugTarget.isTerminated()) { return 0; } return debugTarget.getRootThreadGroups().length; } } return super.getChildCount(element, context, monitor); }
&& event.getSource() instanceof IJavaDebugTarget) { IJavaDebugTarget target = (IJavaDebugTarget) event.getSource(); ILaunch launch = target.getLaunch(); if (launch != null) { ILaunchConfiguration configuration = launch -1, 1, false, map); bp.setPersisted(false); target.breakpointAdded(bp); DebugPlugin.getDefault() .removeDebugEventListener(this);
ILaunch launch = target.getLaunch(); if (launch.getAttribute(ScrapbookLauncher.SCRAPBOOK_LAUNCH) != null) { if (!target.supportsHotCodeReplace()) { return; name = target.getName(); final String preference; final String alertMessage; final String launchName = target.getLaunch().getLaunchConfiguration().getName(); if (exception == null) { status = new Status(IStatus.WARNING, JDIDebugUIPlugin.getUniqueIdentifier(), IStatus.WARNING, DebugUIMessages.JDIDebugUIPlugin_The_target_VM_does_not_support_hot_code_replace_1, null);
if (target != null) { try { return ((IJavaDebugTarget)parent).getThreads(); } catch (DebugException e) { JDIDebugUIPlugin.log(e); for (int j= 0, numTargets= targets.length; j < numTargets; j++) { target= (IJavaDebugTarget)targets[j].getAdapter(IJavaDebugTarget.class); if (target != null && !target.isDisconnected() && !target.isTerminated()) { children.add(target);
ILaunchConfiguration launchConfiguration = javaTarget.getLaunch().getLaunchConfiguration(); boolean isSnippetEditor = false;
IJavaDebugTarget debugTarget = (IJavaDebugTarget)frame.getDebugTarget(); if (Flags.isStatic(field.getFlags())) { IJavaType[] javaTypes = debugTarget.getJavaTypes(field.getDeclaringType().getFullyQualifiedName()); if (javaTypes != null) { for (int j = 0; j < javaTypes.length; j++) { IJavaValue value = null; if (constant instanceof Integer) { value = debugTarget.newValue(((Integer)constant).intValue()); } else if (constant instanceof Byte) { value = debugTarget.newValue(((Byte)constant).byteValue()); } else if (constant instanceof Boolean) { value = debugTarget.newValue(((Boolean)constant).booleanValue()); } else if (constant instanceof Character) { value = debugTarget.newValue(((Character)constant).charValue()); } else if (constant instanceof Double) { value = debugTarget.newValue(((Double)constant).doubleValue()); } else if (constant instanceof Float) { value = debugTarget.newValue(((Float)constant).floatValue()); } else if (constant instanceof Long) { value = debugTarget.newValue(((Long)constant).longValue()); } else if (constant instanceof Short) { value = debugTarget.newValue(((Short)constant).shortValue()); } else if (constant instanceof String) { value = debugTarget.newValue((String)constant);
protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException { if (IDebugUIConstants.ID_DEBUG_VIEW.equals(context.getId())) { if (JavaElementContentProvider.isDisplayThreadGroups()) { return getElements(((IJavaDebugTarget)parent).getRootThreadGroups(), index, length); } } return super.getChildren(parent, index, length, context, monitor); }
public IType getType() throws CoreException { IJavaValue value = resolveValue(); if (value == null || value instanceof IJavaPrimitiveValue) { // no object selected, use the frame return super.getType(); } IType type = null; if (value instanceof IJavaArray) { // completion in context of Object IJavaType[] types = ((IJavaDebugTarget)value.getDebugTarget()).getJavaTypes("java.lang.Object"); //$NON-NLS-1$ if (types.length > 0) { type = JavaDebugUtils.resolveType(types[0]); } } else { type = JavaDebugUtils.resolveType(value); } if (type == null) { unableToResolveType(); } return type; }
IThread[] threads = target.getThreads(); for (int i = 0; i < threads.length; i++) { if (threads[i].isSuspended()) {
/** * Fills the given menu with available stratum. * * @param m */ private void fillMenu(Menu m) { IStackFrame frame = (IStackFrame) fSelection.getFirstElement(); final IJavaStackFrame javaStackFrame = (IJavaStackFrame) frame.getAdapter(IJavaStackFrame.class); try { IJavaReferenceType declaringType = javaStackFrame.getReferenceType(); final IJavaDebugTarget target = (IJavaDebugTarget) javaStackFrame.getDebugTarget(); String currentStratum = target.getDefaultStratum(); String[] strata = declaringType.getAvailableStrata(); for (int i = 0; i < strata.length; i++) { final String stratum = strata[i]; MenuItem item = createMenuItem(m, stratum, javaStackFrame, target); item.setSelection(stratum.equals(currentStratum)); } MenuItem item = createMenuItem(m, null, javaStackFrame, target); item.setSelection(currentStratum == null); } catch (DebugException e) { } }
&& event.getSource() instanceof IJavaDebugTarget) { IJavaDebugTarget target = (IJavaDebugTarget) event.getSource(); ILaunch launch = target.getLaunch(); if (launch != null) { ILaunchConfiguration configuration = launch -1, 1, false, map); bp.setPersisted(false); target.breakpointAdded(bp); DebugPlugin.getDefault() .removeDebugEventListener(this);
List groups = new ArrayList(); try{ delta = delta.addNode(debugTarget, indexOf(launchChildren, debugTarget), IModelDelta.NO_CHANGE, debugTarget.getRootThreadGroups().length); IJavaThread javaThread = (IJavaThread) thread; IJavaThreadGroup threadGroup = javaThread.getThreadGroup(); index = indexOf(debugTarget.getRootThreadGroups(), group);
if(target != null) { IType itype = (IType) selectedElement; IJavaType[] types = target.getJavaTypes(itype.getFullyQualifiedName()); if(types != null && types.length > 0) { type = types[0];
protected void doStore() { IDebugTarget[] targets= getDebugTargets(); IJavaDebugTarget target; IThread[] threads; IJavaThread thread; for (int i= 0, numTargets= targets.length; i < numTargets; i++) { target = (IJavaDebugTarget)targets[i].getAdapter(IJavaDebugTarget.class); if (target != null) { try { if (fThreadViewer.getChecked(target)) { threads= target.getThreads(); for (int j=0, numThreads= threads.length; j < numThreads; j++) { thread= (IJavaThread)threads[j]; if (fThreadViewer.getChecked(thread)) { // thread selected for filtering fPage.getBreakpoint().setThreadFilter(thread); break; // Can only set one filtered thread. } } } else { fPage.getBreakpoint().removeThreadFilter(target); } } catch (CoreException e) { JDIDebugUIPlugin.log(e); } } } }