From 4c211278c0d0edf4fb86da00b36eac39edd348d1 Mon Sep 17 00:00:00 2001 From: Paul Pazderski Date: Sat, 23 May 2020 02:31:41 +0200 Subject: Bug 404990 - [breakpoints] Delete breakpoint, undo, redo, undo. Gone. The issue is located in both, the redo and the second undo operation. Delete breakpoint and redo of this operation have the (for this issue relevant) difference that the first set a 'breakpoint deleted' attribute on the marker while the redo does not set/update this attribute. The simple fix is to move the "mark deleted" into the delete marker operation which is executed from an 'initial' delete as well as from a redo. After fixing that a breakpoint is restored but the view does not updated. BreakpointManager does not properly send added notifications. Most of the time it works because an added breakpoint will be registered and the registration will trigger the added notification. However for the add of the second undo the registered attribute is already set, the setRegister(true) which normally triggers the add notification is not executed. Change-Id: Ib509ec9c8116ac4a7bb3f8bcf38dc470e0b90b8b Signed-off-by: Paul Pazderski --- .../debug/internal/core/BreakpointManager.java | 2 +- org.eclipse.debug.tests/plugin.properties | 3 +- org.eclipse.debug.tests/plugin.xml | 30 ++++- .../org/eclipse/debug/tests/AutomatedSuite.java | 2 + .../tests/breakpoint/BreakpointOrderingTests.java | 112 ----------------- .../debug/tests/breakpoint/BreakpointTests.java | 134 +++++++++++++++++++++ .../debug/tests/breakpoint/TestBreakpoint.java | 78 ++++++++++++ .../viewer/model/DebugTestModelPresentation.java | 56 +++++++++ .../DeleteBreakpointMarkersOperation.java | 55 +++++++++ .../ui/org/eclipse/debug/ui/DebugUITools.java | 9 +- 10 files changed, 356 insertions(+), 125 deletions(-) create mode 100644 org.eclipse.debug.tests/src/org/eclipse/debug/tests/breakpoint/BreakpointTests.java create mode 100644 org.eclipse.debug.tests/src/org/eclipse/debug/tests/breakpoint/TestBreakpoint.java create mode 100644 org.eclipse.debug.tests/src/org/eclipse/debug/tests/viewer/model/DebugTestModelPresentation.java create mode 100644 org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/DeleteBreakpointMarkersOperation.java 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 db02ab649..6d8539d66 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 @@ -763,7 +763,7 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis } }; getWorkspace().run(runnable, null, 0, null); - addBreakpoints(fAdded.toArray(new IBreakpoint[fAdded.size()]), false); + addBreakpoints(fAdded.toArray(new IBreakpoint[fAdded.size()]), true); } catch (CoreException e) { DebugPlugin.log(e); } diff --git a/org.eclipse.debug.tests/plugin.properties b/org.eclipse.debug.tests/plugin.properties index 2643d02af..8fcb3b9f3 100755 --- a/org.eclipse.debug.tests/plugin.properties +++ b/org.eclipse.debug.tests/plugin.properties @@ -20,4 +20,5 @@ renderingType.name.0 = Rendering Two renderingType.name.1 = Rendering Default launchConfigurationType.name = Test Launch Type extension.name = Debug File System -launchConfigurationType.name.0 = Cancelling Launch Type \ No newline at end of file +launchConfigurationType.name.0 = Cancelling Launch Type +testBreakpoint.name = Test Breakpoint \ No newline at end of file diff --git a/org.eclipse.debug.tests/plugin.xml b/org.eclipse.debug.tests/plugin.xml index b697fbdca..ab1d612ec 100644 --- a/org.eclipse.debug.tests/plugin.xml +++ b/org.eclipse.debug.tests/plugin.xml @@ -1,7 +1,7 @@