use of org.eclipse.debug.core.IBreakpointManager in project dbeaver by dbeaver.
the class DatabaseDebugTarget method terminated.
public synchronized void terminated() throws DebugException {
if (!terminated) {
threads.clear();
terminated = true;
suspended = false;
try {
controller.detach(sessionKey, getProgressMonitor());
controller.unregisterEventHandler(this);
} catch (DBGException e) {
String message = NLS.bind("Error terminating {0}", getName());
IStatus status = DebugCore.newErrorStatus(message, e);
throw new DebugException(status);
} finally {
controller.dispose();
}
DebugPlugin debugPlugin = DebugPlugin.getDefault();
if (debugPlugin != null) {
IBreakpointManager breakpointManager = debugPlugin.getBreakpointManager();
breakpointManager.removeBreakpointListener(this);
debugPlugin.removeDebugEventListener(this);
breakpointManager.removeBreakpointManagerListener(this);
}
if (!getProcess().isTerminated()) {
try {
process.terminate();
} catch (DebugException e) {
// do nothing
}
}
if (debugPlugin != null) {
fireTerminateEvent();
}
}
}
use of org.eclipse.debug.core.IBreakpointManager in project liferay-ide by liferay.
the class FMDebugTarget method getEnabledLineBreakpoints.
private ILineBreakpoint[] getEnabledLineBreakpoints() {
List<ILineBreakpoint> breakpoints = new ArrayList<ILineBreakpoint>();
final IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager();
if (breakpointManager.isEnabled()) {
IBreakpoint[] fmBreakpoints = breakpointManager.getBreakpoints(getModelIdentifier());
for (IBreakpoint fmBreakpoint : fmBreakpoints) {
try {
if (fmBreakpoint instanceof ILineBreakpoint && supportsBreakpoint(fmBreakpoint) && fmBreakpoint.isEnabled()) {
breakpoints.add((ILineBreakpoint) fmBreakpoint);
}
} catch (CoreException e) {
}
}
}
return breakpoints.toArray(new ILineBreakpoint[0]);
}
use of org.eclipse.debug.core.IBreakpointManager 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.IBreakpointManager 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.IBreakpointManager 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;
}
Aggregations