/** * Returns a shared utility Java debug model presentation. Clients should not * dispose the presentation. * * @return a Java debug model presentation */ public IDebugModelPresentation getModelPresentation() { if (fUtilPresentation == null) { fUtilPresentation = DebugUITools.newDebugModelPresentation(JDIDebugModel.getPluginIdentifier()); } return fUtilPresentation; }
/** * Creates an "invisible" line breakpoint. */ IBreakpoint createMagicBreakpoint(String typeName) throws CoreException{ //set a breakpoint on the Thread.sleep(100); line of the nop method of ScrapbookMain fMagicBreakpoint= JDIDebugModel.createLineBreakpoint(ResourcesPlugin.getWorkspace().getRoot(), typeName, 59, -1, -1, 0, false, null); fMagicBreakpoint.setPersisted(false); return fMagicBreakpoint; }
/** * Creates a new debug target for the given virtual machine and system process * that is connected on the specified port for the given launch. * * @param config run configuration used to launch the VM * @param launch launch to add the target to * @param port port the VM is connected to * @param process associated system process * @param vm JDI virtual machine * @return the {@link IDebugTarget} */ protected IDebugTarget createDebugTarget(VMRunnerConfiguration config, ILaunch launch, int port, IProcess process, VirtualMachine vm) { return JDIDebugModel.newDebugTarget(launch, vm, renderDebugTarget(config.getClassToLaunch(), port), process, true, false, config.isResumeOnStartup()); }
IJavaLaunchConfigurationConstants.ATTR_STOP_IN_MAIN); IJavaMethodBreakpoint bp = JDIDebugModel .createMethodBreakpoint( ResourcesPlugin .getWorkspace()
public void run(IAction action) { IStructuredSelection ss = (IStructuredSelection)fSelection; Iterator iterator = ss.iterator(); IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(JDIDebugModel.getPluginIdentifier()); while (iterator.hasNext()) { IType type = (IType) iterator.next(); end= start + range.getLength(); JDIDebugModel.createClassPrepareBreakpoint(BreakpointUtils.getBreakpointResource(type), type.getFullyQualifiedName(), kind, start, end, true, map);
IResource resource = BreakpointUtils.getBreakpointResource(type); int lnumber = ((ITextSelection) selection).getStartLine() + 1; IJavaLineBreakpoint existingBreakpoint = JDIDebugModel.lineBreakpointExists(resource, tname, lnumber); if (existingBreakpoint != null) { DebugPlugin.getDefault().getBreakpointManager().removeBreakpoint(existingBreakpoint, true); IJavaLineBreakpoint breakpoint = JDIDebugModel.createLineBreakpoint(resource, tname, lnumber, -1, -1, 0, true, attributes); new BreakpointLocationVerifierJob(document, breakpoint, lnumber, bestMatch, tname, type, resource, editor).schedule();
try { boolean differentLineNumber= lineNumber != fLineNumber; IJavaLineBreakpoint breakpoint= JDIDebugModel.lineBreakpointExists(fResource, typeName, lineNumber); boolean breakpointExist= breakpoint != null; if (fBreakpoint == null) {
protected IStatus run(IProgressMonitor monitor) { try { JDIDebugModel.createExceptionBreakpoint(resource, type.getFullyQualifiedName(), caught, uncaught, isChecked(type), true, map); return Status.OK_STATUS; } catch (CoreException e) { return e.getStatus(); } }
protected IStatus run(IProgressMonitor monitor) { try { JDIDebugModel.createClassPrepareBreakpoint(resource, type.getFullyQualifiedName(), finalKind, finalStart, finalEnd, true, map); return Status.OK_STATUS; } catch (CoreException e) { return e.getStatus(); } }
/** * Activates this debug options manager. When active, this * manager becomes a listener to many notifications and updates * running debug targets based on these notifications. * * A debug options manager does not need to be activated until * there is a running debug target. */ private void activate() { if (fActivated) { return; } fActivated = true; initializeProblemHandling(); notifyTargetsOfFilters(); DebugPlugin.getDefault().addDebugEventListener(this); JDIDebugModel.addJavaBreakpointListener(this); JavaLogicalStructures.addStructuresListener(this); }
JDIDebugModel.addHotCodeReplaceListener(fHCRListener);
IJavaLaunchConfigurationConstants.ATTR_STOP_IN_MAIN); IJavaMethodBreakpoint bp = JDIDebugModel .createMethodBreakpoint( ResourcesPlugin .getWorkspace()
IJavaLineBreakpoint existingBreakpoint = JDIDebugModel.lineBreakpointExists(resource, typeName, lineNumber); if (existingBreakpoint != null) { removeBreakpoint(existingBreakpoint, true);
protected IStatus run(IProgressMonitor monitor) { MultiStatus status = new MultiStatus(JDIDebugUIPlugin.getUniqueIdentifier(), IJavaDebugUIConstants.INTERNAL_ERROR, DebugUIMessages.JavaDebugOptionsManager_1, null); // compilation error breakpoint try { IJavaExceptionBreakpoint bp = JDIDebugModel.createExceptionBreakpoint(ResourcesPlugin.getWorkspace().getRoot(),"java.lang.Error", true, true, false, false, null); //$NON-NLS-1$ bp.setPersisted(false); setSuspendOnCompilationErrorsBreakpoint(bp); } catch (CoreException e) { status.add(e.getStatus()); } // uncaught exception breakpoint try { IJavaExceptionBreakpoint bp = JDIDebugModel.createExceptionBreakpoint(ResourcesPlugin.getWorkspace().getRoot(),"java.lang.Throwable", false, true, false, false, null); //$NON-NLS-1$ ((JavaExceptionBreakpoint)bp).setSuspendOnSubclasses(true); bp.setPersisted(false); setSuspendOnUncaughtExceptionBreakpoint(bp); } catch (CoreException e) { status.add(e.getStatus()); } if (status.getChildren().length == 0) { return Status.OK_STATUS; } return status; } }
end = start + range.getLength(); JDIDebugModel.createClassPrepareBreakpoint(BreakpointUtils.getBreakpointResource(member), createQualifiedTypeName(type), IJavaClassPrepareBreakpoint.TYPE_CLASS, start, end, true, map);
/** * Returns a debug model presentation (creating one * if necessary). * * @return debug model presentation */ protected IDebugModelPresentation getDebugModelPresentation() { if (fPresentation == null) { fPresentation = DebugUITools.newDebugModelPresentation(JDIDebugModel.getPluginIdentifier()); } return fPresentation; }
public Change perform(IProgressMonitor pm) throws CoreException { Map map = new HashMap(); BreakpointUtils.addJavaBreakpointAttributes(map, fDestMethod); IResource resource = BreakpointUtils.getBreakpointResource(fDestMethod); int range[] = getNewLineNumberAndRange(fDestMethod); IJavaMethodBreakpoint breakpoint = JDIDebugModel.createMethodBreakpoint( resource, fDestMethod.getDeclaringType().getFullyQualifiedName(), fDestMethod.getElementName(), fDestMethod.getSignature(), isEntry(), isExit(), isNativeOnly(), range[0], range[1], range[2], getHitCount(), true, map); apply(breakpoint); getOriginalBreakpoint().delete(); return new DeleteBreakpointChange(breakpoint); }
private void createLineBreakpoint(IResource resource, String typeName, int offset, int lineNumber, int charStart, int charEnd, int hitCount, boolean register, Map attributes, IDocument document, boolean bestMatch, IType type, IEditorPart editorPart) throws CoreException { IJavaLineBreakpoint breakpoint = JDIDebugModel.createLineBreakpoint(resource, typeName, lineNumber, charStart, charEnd, hitCount, register, attributes); new BreakpointLocationVerifierJob(document, breakpoint, offset, lineNumber, typeName, type, resource, editorPart).schedule(); }
/** * Creates a new debug target for the given virtual machine and system process * that is connected on the specified port for the given launch. * * @param config run configuration used to launch the VM * @param launch launch to add the target to * @param port port the VM is connected to * @param process associated system process * @param vm JDI virtual machine * @return the {@link IDebugTarget} */ protected IDebugTarget createDebugTarget(VMRunnerConfiguration config, ILaunch launch, int port, IProcess process, VirtualMachine vm) { return JDIDebugModel.newDebugTarget(launch, vm, renderDebugTarget(config.getClassToLaunch(), port), process, true, false, config.isResumeOnStartup()); }
IType declaringType = member.getDeclaringType(); IResource resource = BreakpointUtils.getBreakpointResource(declaringType); IJavaLineBreakpoint breakpoint = JDIDebugModel.lineBreakpointExists(resource, createQualifiedTypeName(declaringType), ts.getStartLine() + 1); if (breakpoint != null) { breakpoint.delete();