Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry BLIND2019-03-02 12:26:58 -0500
committerThierry BLIND2019-03-02 12:26:58 -0500
commit1f0b19d56f63dfd1c8e025d945008581e38fb0d9 (patch)
treea8204c5380cc637d61d77589b321f74d2b9a8386
parent28c3a178e1b900c6b9f68826205ab5033e2bac38 (diff)
downloadorg.eclipse.pdt-1f0b19d56f63dfd1c8e025d945008581e38fb0d9.tar.gz
org.eclipse.pdt-1f0b19d56f63dfd1c8e025d945008581e38fb0d9.tar.xz
org.eclipse.pdt-1f0b19d56f63dfd1c8e025d945008581e38fb0d9.zip
Bug 538315 - Xdebug breaks at deleted breakpoints
Better handling of CTRL-SHIFT-B and CTRL-ALT-B Change-Id: Ie71408504937fea9eacecfe53f28977bd11d269c Signed-off-by: Thierry BLIND <thierryblind@msn.com>
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/xdebug/dbgp/model/DBGpTarget.java16
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/model/PHPDebugTarget.java16
2 files changed, 22 insertions, 10 deletions
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/xdebug/dbgp/model/DBGpTarget.java b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/xdebug/dbgp/model/DBGpTarget.java
index f62d1b8af..69359fbc5 100644
--- a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/xdebug/dbgp/model/DBGpTarget.java
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/xdebug/dbgp/model/DBGpTarget.java
@@ -1988,10 +1988,16 @@ public class DBGpTarget extends DBGpElement
public void breakpointRemoved(IBreakpoint breakpoint, boolean onlyHandleEnabledBreakpoints) {
if (supportsBreakpoint(breakpoint)) {
try {
- if (onlyHandleEnabledBreakpoints && !breakpoint.isEnabled()) {
+ if (onlyHandleEnabledBreakpoints
+ // Since eclipse 4.10, breakpoint.isEnabled() is always
+ // false when disabling the breakpoint using
+ // CTRL-SHIFT-B, so add getMarker().exists() check.
+ && breakpoint.getMarker().exists() && !breakpoint.isEnabled()) {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=538315
- // already handled by breakpointChanged(IBreakpoint, IMarkerDelta),
- // nothing more to do
+ // XXX: the breakpoint removal was already handled by
+ // breakpointChanged(IBreakpoint, IMarkerDelta), stop here...
+ // ... except that getMarker().exists() will be false when
+ // deleting an already-disabled breakpoint using CTRL-SHIFT-B.
return;
}
} catch (CoreException e) {
@@ -2084,6 +2090,7 @@ public class DBGpTarget extends DBGpElement
if (breakpoint.isEnabled()) {
breakpointAdded(breakpoint);
} else {
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=538315
// force removal of this breakpoint
breakpointRemoved(breakpoint, false);
}
@@ -2100,7 +2107,7 @@ public class DBGpTarget extends DBGpElement
if (deltaMap == null) {
deltaMap = new HashMap<>();
}
- if (map.equals(deltaMap)) {
+ if (map.entrySet().containsAll(deltaMap.entrySet())) {
// no changes were found, this
// happens when another breakpoint
// (than current one) was deleted
@@ -2113,7 +2120,6 @@ public class DBGpTarget extends DBGpElement
if (DBGpLogger.debugBP()) {
DBGpLogger.debug("at least one attribute changed for breakpoint with ID: " + bp.getID()); //$NON-NLS-1$
}
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=538315
breakpointRemoved(breakpoint, null);
breakpointAdded(breakpoint);
}
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/model/PHPDebugTarget.java b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/model/PHPDebugTarget.java
index e3e52f863..79a6df4e0 100644
--- a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/model/PHPDebugTarget.java
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/model/PHPDebugTarget.java
@@ -618,10 +618,16 @@ public class PHPDebugTarget extends PHPDebugElement
public void breakpointRemoved(IBreakpoint breakpoint, boolean onlyHandleEnabledBreakpoints) {
if (supportsBreakpoint(breakpoint)) {
try {
- if (onlyHandleEnabledBreakpoints && !breakpoint.isEnabled()) {
+ if (onlyHandleEnabledBreakpoints
+ // Since eclipse 4.10, breakpoint.isEnabled() is always
+ // false when disabling the breakpoint using
+ // CTRL-SHIFT-B, so add getMarker().exists() check.
+ && breakpoint.getMarker().exists() && !breakpoint.isEnabled()) {
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=538315
- // already handled by breakpointChanged(IBreakpoint, IMarkerDelta),
- // nothing more to do
+ // XXX: the breakpoint removal was already handled by
+ // breakpointChanged(IBreakpoint, IMarkerDelta), stop here...
+ // ... except that getMarker().exists() will be false when
+ // deleting an already-disabled breakpoint using CTRL-SHIFT-B.
return;
}
} catch (CoreException e) {
@@ -670,6 +676,7 @@ public class PHPDebugTarget extends PHPDebugElement
if (breakpoint.isEnabled()) {
breakpointAdded(breakpoint);
} else {
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=538315
// force removal of this breakpoint
breakpointRemoved(breakpoint, false);
}
@@ -685,7 +692,7 @@ public class PHPDebugTarget extends PHPDebugElement
if (deltaMap == null) {
deltaMap = new HashMap<>();
}
- if (map.equals(deltaMap)) {
+ if (map.entrySet().containsAll(deltaMap.entrySet())) {
// no changes were found, this
// happens when another breakpoint
// (than current one) was deleted
@@ -695,7 +702,6 @@ public class PHPDebugTarget extends PHPDebugElement
return;
}
if (breakpoint.isEnabled()) {
- // https://bugs.eclipse.org/bugs/show_bug.cgi?id=538315
breakpointRemoved(breakpoint, null);
breakpointAdded(breakpoint);
}

Back to the top