diff options
author | Dani Megert | 2011-01-13 13:15:26 +0000 |
---|---|---|
committer | Dani Megert | 2011-01-13 13:15:26 +0000 |
commit | 37369c80382ef730f0fdf401456324de52444782 (patch) | |
tree | 2b53aaa218e8b44b43007e9ffe30e14c32f238da /org.eclipse.debug.core | |
parent | 1fa60b4996516d04be3941d435f0d11654c8d033 (diff) | |
download | eclipse.platform.debug-37369c80382ef730f0fdf401456324de52444782.tar.gz eclipse.platform.debug-37369c80382ef730f0fdf401456324de52444782.tar.xz eclipse.platform.debug-37369c80382ef730f0fdf401456324de52444782.zip |
Fixed bug 334007: Breakpoint undo should not automatically register a breakpoint
Diffstat (limited to 'org.eclipse.debug.core')
-rw-r--r-- | org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java | 40 | ||||
-rw-r--r-- | org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java | 17 |
2 files changed, 41 insertions, 16 deletions
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java index 308bcfb72..7b9d27b71 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. + * Copyright (c) 2000, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -26,9 +26,17 @@ import javax.xml.parsers.FactoryConfigurationError; import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.TransformerException; -import org.eclipse.core.resources.ISaveContext; -import org.eclipse.core.resources.ISaveParticipant; -import org.eclipse.core.resources.ResourcesPlugin; +import com.ibm.icu.text.MessageFormat; + +import org.osgi.framework.BundleContext; +import org.xml.sax.SAXException; +import org.xml.sax.helpers.DefaultHandler; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +import org.eclipse.osgi.service.environment.Constants; + import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IAdapterManager; @@ -44,6 +52,11 @@ import org.eclipse.core.runtime.Plugin; import org.eclipse.core.runtime.SafeRunner; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; + +import org.eclipse.core.resources.ISaveContext; +import org.eclipse.core.resources.ISaveParticipant; +import org.eclipse.core.resources.ResourcesPlugin; + import org.eclipse.debug.core.model.IDebugElement; import org.eclipse.debug.core.model.IDisconnect; import org.eclipse.debug.core.model.IDropToFrame; @@ -67,14 +80,6 @@ import org.eclipse.debug.internal.core.Preferences; import org.eclipse.debug.internal.core.StepFilterManager; import org.eclipse.debug.internal.core.commands.CommandAdapterFactory; import org.eclipse.debug.internal.core.sourcelookup.SourceLookupUtils; -import org.eclipse.osgi.service.environment.Constants; -import org.osgi.framework.BundleContext; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.xml.sax.SAXException; -import org.xml.sax.helpers.DefaultHandler; - -import com.ibm.icu.text.MessageFormat; /** * There is one instance of the debug plug-in available from @@ -286,6 +291,17 @@ public class DebugPlugin extends Plugin { */ public static final String PREF_DELETE_CONFIGS_ON_PROJECT_DELETE = DebugPlugin.getUniqueIdentifier() + ".PREF_DELETE_CONFIGS_ON_PROJECT_DELETE"; //$NON-NLS-1$ + /** + * Deleted breakpoint marker attribute (value + * <code>"org.eclipse.debug.core.breakpointIsDeleted"</code>). The attribute is a + * <code>boolean</code> corresponding to the deleted state of a breakpoint. + * + * @see org.eclipse.core.resources.IMarker#getAttribute(String, boolean) + * @since 3.7 + */ + public static final String ATTR_BREAKPOINT_IS_DELETED= DebugPlugin.getUniqueIdentifier() + ".breakpointIsDeleted"; //$NON-NLS-1$ + + /** * The singleton debug plug-in instance. diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java index 5cddb5924..c7f12a82f 100644 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java +++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java @@ -727,6 +727,17 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis } if (!fAdded.isEmpty()) { try { + IWorkspaceRunnable runnable= new IWorkspaceRunnable() { + public void run(IProgressMonitor monitor) throws CoreException { + Iterator iter= fAdded.iterator(); + while (iter.hasNext()) { + IBreakpoint breakpoint= (IBreakpoint)iter.next(); + breakpoint.getMarker().setAttribute(DebugPlugin.ATTR_BREAKPOINT_IS_DELETED, false); + breakpoint.setRegistered(true); + } + } + }; + getWorkspace().run(runnable, null, 0, null); addBreakpoints((IBreakpoint[])fAdded.toArray(new IBreakpoint[fAdded.size()]), false); } catch (CoreException e) { DebugPlugin.log(e); @@ -787,11 +798,9 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis if (fPostChangMarkersChanged.contains(marker)) { handleChangeBreakpoint(marker, mDelta); fPostChangMarkersChanged.remove(marker); - } else if (getBreakpoint(marker) == null) { + } else if (marker.getAttribute(DebugPlugin.ATTR_BREAKPOINT_IS_DELETED, false) && getBreakpoint(marker) == null) { try { - IBreakpoint breakpoint= createBreakpoint(marker); - breakpoint.setRegistered(true); - fAdded.add(breakpoint); + fAdded.add(createBreakpoint(marker)); } catch (CoreException e) { DebugPlugin.log(e); } |