Search in sources :

Example 6 with IBreakpoint

use of org.eclipse.debug.core.model.IBreakpoint 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]);
}
Also used : CoreException(org.eclipse.core.runtime.CoreException) ArrayList(java.util.ArrayList) ILineBreakpoint(org.eclipse.debug.core.model.ILineBreakpoint) IBreakpointManager(org.eclipse.debug.core.IBreakpointManager) IBreakpoint(org.eclipse.debug.core.model.IBreakpoint)

Example 7 with IBreakpoint

use of org.eclipse.debug.core.model.IBreakpoint in project watchdog by TestRoots.

the class BreakpointCreatorTest method testCreateBreakpointHash.

@Test
public void testCreateBreakpointHash() {
    IBreakpoint bp = mock(IBreakpoint.class);
    Breakpoint result = BreakpointCreator.createBreakpoint(bp);
    assertEquals(bp.hashCode(), result.getHash());
}
Also used : Breakpoint(nl.tudelft.watchdog.core.logic.breakpoint.Breakpoint) IBreakpoint(org.eclipse.debug.core.model.IBreakpoint) IJavaLineBreakpoint(org.eclipse.jdt.debug.core.IJavaLineBreakpoint) IJavaBreakpoint(org.eclipse.jdt.debug.core.IJavaBreakpoint) IBreakpoint(org.eclipse.debug.core.model.IBreakpoint) Test(org.junit.Test)

Example 8 with IBreakpoint

use of org.eclipse.debug.core.model.IBreakpoint in project watchdog by TestRoots.

the class BreakpointCreatorTest method testCreateBreakpointEnabled.

@Test
public void testCreateBreakpointEnabled() throws CoreException {
    IBreakpoint bp = mock(IBreakpoint.class);
    when(bp.isEnabled()).thenReturn(true);
    Breakpoint result = BreakpointCreator.createBreakpoint(bp);
    assertTrue(result.isEnabled());
}
Also used : Breakpoint(nl.tudelft.watchdog.core.logic.breakpoint.Breakpoint) IBreakpoint(org.eclipse.debug.core.model.IBreakpoint) IJavaLineBreakpoint(org.eclipse.jdt.debug.core.IJavaLineBreakpoint) IJavaBreakpoint(org.eclipse.jdt.debug.core.IJavaBreakpoint) IBreakpoint(org.eclipse.debug.core.model.IBreakpoint) Test(org.junit.Test)

Example 9 with IBreakpoint

use of org.eclipse.debug.core.model.IBreakpoint in project watchdog by TestRoots.

the class BreakpointCreatorTest method testCreateBreakpointType.

@Test
public void testCreateBreakpointType() {
    IBreakpoint bp = mock(IBreakpoint.class);
    Breakpoint result = BreakpointCreator.createBreakpoint(bp);
    assertEquals(BreakpointType.UNDEFINED, result.getBreakpointType());
}
Also used : Breakpoint(nl.tudelft.watchdog.core.logic.breakpoint.Breakpoint) IBreakpoint(org.eclipse.debug.core.model.IBreakpoint) IJavaLineBreakpoint(org.eclipse.jdt.debug.core.IJavaLineBreakpoint) IJavaBreakpoint(org.eclipse.jdt.debug.core.IJavaBreakpoint) IBreakpoint(org.eclipse.debug.core.model.IBreakpoint) Test(org.junit.Test)

Example 10 with IBreakpoint

use of org.eclipse.debug.core.model.IBreakpoint in project watchdog by TestRoots.

the class BreakpointListener method breakpointRemoved.

@Override
public void breakpointRemoved(IBreakpoint breakpoint, IMarkerDelta delta) {
    Date timestamp = new Date();
    Breakpoint bp = BreakpointCreator.createBreakpoint(breakpoint);
    breakpoints.remove(bp.getHash());
    BreakpointRemoveEvent event = new BreakpointRemoveEvent(bp.getHash(), bp.getBreakpointType(), timestamp);
    TrackingEventManager.addEvent(event);
}
Also used : Breakpoint(nl.tudelft.watchdog.core.logic.breakpoint.Breakpoint) IBreakpoint(org.eclipse.debug.core.model.IBreakpoint) BreakpointRemoveEvent(nl.tudelft.watchdog.core.logic.event.eventtypes.debugging.BreakpointRemoveEvent) Date(java.util.Date)

Aggregations

IBreakpoint (org.eclipse.debug.core.model.IBreakpoint)36 CoreException (org.eclipse.core.runtime.CoreException)12 IBreakpointManager (org.eclipse.debug.core.IBreakpointManager)12 Breakpoint (nl.tudelft.watchdog.core.logic.breakpoint.Breakpoint)9 IResource (org.eclipse.core.resources.IResource)9 ILineBreakpoint (org.eclipse.debug.core.model.ILineBreakpoint)9 ArrayList (java.util.ArrayList)6 IJavaBreakpoint (org.eclipse.jdt.debug.core.IJavaBreakpoint)6 IJavaLineBreakpoint (org.eclipse.jdt.debug.core.IJavaLineBreakpoint)6 IStatus (org.eclipse.core.runtime.IStatus)5 ITextSelection (org.eclipse.jface.text.ITextSelection)5 Test (org.junit.Test)5 Breakpoint (freemarker.debug.Breakpoint)4 IMarker (org.eclipse.core.resources.IMarker)4 ITextEditor (org.eclipse.ui.texteditor.ITextEditor)4 ErlangLineBreakpoint (org.erlide.backend.debug.ErlangLineBreakpoint)4 RemoteException (java.rmi.RemoteException)3 Date (java.util.Date)3 HashMap (java.util.HashMap)3 Map (java.util.Map)3