use of org.eclipse.debug.core.model.IBreakpoint in project watchdog by TestRoots.
the class BreakpointListener method breakpointChanged.
@Override
public void breakpointChanged(IBreakpoint breakpoint, IMarkerDelta delta) {
Date timestamp = new Date();
Breakpoint bp = BreakpointCreator.createBreakpoint(breakpoint);
// Replace entry if present, otherwise create new entry.
Breakpoint old = breakpoints.put(bp.getHash(), bp);
List<BreakpointChangeType> changes = BreakpointChangeClassifier.classify(old, bp);
BreakpointChangeEvent event = new BreakpointChangeEvent(bp.getHash(), bp.getBreakpointType(), changes, timestamp);
TrackingEventManager.addEvent(event);
}
use of org.eclipse.debug.core.model.IBreakpoint in project webtools.sourceediting by eclipse.
the class ToggleBreakpointsTarget method getBreakpoints.
private IBreakpoint[] getBreakpoints(IResource resource, IDocument document, AbstractMarkerAnnotationModel model, int lineNumber) {
List<IMarker> markers = new ArrayList<>();
if (resource != null && model != null && resource.exists()) {
try {
IMarker[] allMarkers = resource.findMarkers(IBreakpoint.LINE_BREAKPOINT_MARKER, true, IResource.DEPTH_ZERO);
if (allMarkers != null) {
for (int i = 0; i < allMarkers.length; i++) {
Position p = model.getMarkerPosition(allMarkers[i]);
int markerLine = -1;
try {
markerLine = document.getLineOfOffset(p.getOffset());
} catch (BadLocationException e1) {
}
if (markerLine == lineNumber) {
markers.add(allMarkers[i]);
}
}
}
} catch (CoreException x) {
}
}
IBreakpointManager manager = DebugPlugin.getDefault().getBreakpointManager();
List<IBreakpoint> breakpoints = new ArrayList<>(markers.size());
for (int i = 0; i < markers.size(); i++) {
IBreakpoint breakpoint = manager.getBreakpoint(markers.get(i));
if (breakpoint != null) {
breakpoints.add(breakpoint);
}
}
return breakpoints.toArray(new IBreakpoint[0]);
}
use of org.eclipse.debug.core.model.IBreakpoint in project webtools.sourceediting by eclipse.
the class JavaScriptBreakpointProvider method isBreakpointExist.
/*
* @param res @param lineNumber @return boolean
*/
private boolean isBreakpointExist(IResource res, int lineNumber) {
IBreakpointManager manager = DebugPlugin.getDefault().getBreakpointManager();
IBreakpoint[] breakpoints = manager.getBreakpoints();
for (int i = 0; i < breakpoints.length; i++) {
if (!(breakpoints[i] instanceof JavascriptLineBreakpoint))
continue;
JavascriptLineBreakpoint breakpoint = (JavascriptLineBreakpoint) breakpoints[i];
try {
if (breakpoint.getResource().equals(res) && breakpoint.getLineNumber() == lineNumber) {
return true;
}
} catch (CoreException e) {
return true;
}
}
return false;
}
use of org.eclipse.debug.core.model.IBreakpoint in project webtools.sourceediting by eclipse.
the class JAXPJavaLaunchConfigurationDelegate method getBreakpoints.
/**
* Get the Java breakpoint and the XSL breakpoints
*/
@Override
protected IBreakpoint[] getBreakpoints(ILaunchConfiguration configuration) {
IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager();
if (!breakpointManager.isEnabled())
return null;
IBreakpoint[] javaBreakpoints = super.getBreakpoints(configuration);
IBreakpoint[] xslBreakpoints = breakpointManager.getBreakpoints(IXSLConstants.ID_XSL_DEBUG_MODEL);
IBreakpoint[] breakpoints = new IBreakpoint[javaBreakpoints.length + xslBreakpoints.length];
System.arraycopy(javaBreakpoints, 0, breakpoints, 0, javaBreakpoints.length);
System.arraycopy(xslBreakpoints, 0, breakpoints, javaBreakpoints.length, xslBreakpoints.length);
return breakpoints;
}
use of org.eclipse.debug.core.model.IBreakpoint in project webtools.sourceediting by eclipse.
the class JAXPDebugTarget method breakpointHit.
private void breakpointHit(String event) {
// determine which breakpoint was hit, and set the thread's breakpoint
int lastSpace = event.lastIndexOf(' ');
if (lastSpace > 0) {
String line = event.substring(lastSpace + 1);
int lineNumber = Integer.parseInt(line);
IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(IXSLConstants.ID_XSL_DEBUG_MODEL);
for (IBreakpoint breakpoint : breakpoints) {
if (supportsBreakpoint(breakpoint)) {
if (breakpoint instanceof ILineBreakpoint) {
ILineBreakpoint lineBreakpoint = (ILineBreakpoint) breakpoint;
try {
if (lineBreakpoint.getLineNumber() == lineNumber) {
thread.setBreakpoints(new IBreakpoint[] { breakpoint });
break;
}
} catch (CoreException e) {
}
}
}
}
}
suspended(DebugEvent.BREAKPOINT);
}
Aggregations