diff options
Diffstat (limited to 'dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/breakpoints/DsfTestBreakpoint.java')
-rw-r--r-- | dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/breakpoints/DsfTestBreakpoint.java | 89 |
1 files changed, 43 insertions, 46 deletions
diff --git a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/breakpoints/DsfTestBreakpoint.java b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/breakpoints/DsfTestBreakpoint.java index de8294ef819..385af241ac5 100644 --- a/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/breakpoints/DsfTestBreakpoint.java +++ b/dsf/org.eclipse.cdt.tests.dsf/src/org/eclipse/cdt/tests/dsf/breakpoints/DsfTestBreakpoint.java @@ -7,7 +7,7 @@ * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Contributors: * Wind River Systems - initial API and implementation *******************************************************************************/ @@ -27,52 +27,49 @@ import org.eclipse.debug.core.model.IBreakpoint; * Test breakpoint. */ public class DsfTestBreakpoint extends Breakpoint { - - public static final String DSF_TEST_BREAKPOINT_MODEL_ID = "dsfTest"; - public static final String ATTR_IDE_PREFIX = DSF_TEST_BREAKPOINT_MODEL_ID + ".ide."; - - public static final String ATTR_ID = ATTR_IDE_PREFIX + "id"; - public static final String ATTR_NUM_TARGET_BREAKPOINTS = ATTR_IDE_PREFIX + "numTargetBreakpoints"; - public static final String ATTR_TRANSLATED = ATTR_IDE_PREFIX + "translated"; - public static final String ATTR_UNTRANSLATED = ATTR_IDE_PREFIX + "untranslated"; - public static final String ATTR_UPDATABLE = ATTR_IDE_PREFIX + "updatable"; - public static int fgIdCounter = 0; + public static final String DSF_TEST_BREAKPOINT_MODEL_ID = "dsfTest"; + public static final String ATTR_IDE_PREFIX = DSF_TEST_BREAKPOINT_MODEL_ID + ".ide."; + + public static final String ATTR_ID = ATTR_IDE_PREFIX + "id"; + public static final String ATTR_NUM_TARGET_BREAKPOINTS = ATTR_IDE_PREFIX + "numTargetBreakpoints"; + public static final String ATTR_TRANSLATED = ATTR_IDE_PREFIX + "translated"; + public static final String ATTR_UNTRANSLATED = ATTR_IDE_PREFIX + "untranslated"; + public static final String ATTR_UPDATABLE = ATTR_IDE_PREFIX + "updatable"; + + public static int fgIdCounter = 0; + + public DsfTestBreakpoint() throws CoreException { + this(true, 1, "", "", ""); + } + + public DsfTestBreakpoint(final boolean enabled, final int numTargetBPs, final String translated, + final String untranslated, final String updatable) throws CoreException { + final IResource resource = ResourcesPlugin.getWorkspace().getRoot(); + IWorkspaceRunnable runnable = new IWorkspaceRunnable() { + @Override + public void run(IProgressMonitor monitor) throws CoreException { + IMarker marker = resource.createMarker("org.eclipse.cdt.tests.dsf.markerType.breakpoint"); + setMarker(marker); + marker.setAttribute(IBreakpoint.ENABLED, enabled); + marker.setAttribute(DsfTestBreakpoint.ATTR_ID, fgIdCounter++); + marker.setAttribute(DsfTestBreakpoint.ATTR_NUM_TARGET_BREAKPOINTS, numTargetBPs); + marker.setAttribute(DsfTestBreakpoint.ATTR_TRANSLATED, translated); + marker.setAttribute(DsfTestBreakpoint.ATTR_UNTRANSLATED, untranslated); + marker.setAttribute(DsfTestBreakpoint.ATTR_UPDATABLE, updatable); + } + }; + run(getMarkerRule(resource), runnable); + DebugPlugin.getDefault().getBreakpointManager().addBreakpoint(this); + } + + public Integer getID() throws CoreException { + return (Integer) ensureMarker().getAttribute(ATTR_ID); + } - public DsfTestBreakpoint() throws CoreException { - this(true, 1, "", "", ""); - } + @Override + public String getModelIdentifier() { + return DSF_TEST_BREAKPOINT_MODEL_ID; + } - public DsfTestBreakpoint(final boolean enabled, final int numTargetBPs, final String translated, - final String untranslated, final String updatable) - throws CoreException - { - final IResource resource = ResourcesPlugin.getWorkspace().getRoot(); - IWorkspaceRunnable runnable = new IWorkspaceRunnable() { - @Override - public void run(IProgressMonitor monitor) throws CoreException { - IMarker marker = resource.createMarker("org.eclipse.cdt.tests.dsf.markerType.breakpoint"); - setMarker(marker); - marker.setAttribute(IBreakpoint.ENABLED, enabled); - marker.setAttribute(DsfTestBreakpoint.ATTR_ID, fgIdCounter++); - marker.setAttribute(DsfTestBreakpoint.ATTR_NUM_TARGET_BREAKPOINTS, numTargetBPs); - marker.setAttribute(DsfTestBreakpoint.ATTR_TRANSLATED, translated); - marker.setAttribute(DsfTestBreakpoint.ATTR_UNTRANSLATED, untranslated); - marker.setAttribute(DsfTestBreakpoint.ATTR_UPDATABLE, updatable); - } - }; - run(getMarkerRule(resource), runnable); - DebugPlugin.getDefault().getBreakpointManager().addBreakpoint(this); - } - - public Integer getID() throws CoreException { - return (Integer)ensureMarker().getAttribute(ATTR_ID); - } - - @Override - public String getModelIdentifier() { - return DSF_TEST_BREAKPOINT_MODEL_ID; - } - - } |