Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/xdebug/dbgp/model/DBGpTarget.java50
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/zend/model/PHPDebugTarget.java43
2 files changed, 74 insertions, 19 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 8243d4efa..30f3d6f9e 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2017 IBM Corporation and others.
+ * Copyright (c) 2009, 2017, 2019 IBM Corporation and others.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
@@ -1981,7 +1981,22 @@ public class DBGpTarget extends DBGpElement
*/
@Override
public void breakpointRemoved(IBreakpoint breakpoint, IMarkerDelta delta) {
+ breakpointRemoved(breakpoint, true);
+ }
+
+ public void breakpointRemoved(IBreakpoint breakpoint, boolean onlyHandleEnabledBreakpoints) {
if (supportsBreakpoint(breakpoint)) {
+ try {
+ if (onlyHandleEnabledBreakpoints && !breakpoint.isEnabled()) {
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=538315
+ // already handled by breakpointChanged(IBreakpoint, IMarkerDelta),
+ // nothing more to do
+ return;
+ }
+ } catch (CoreException e) {
+ DBGpLogger.logException("Exception Removing Breakpoint", this, e); //$NON-NLS-1$
+ return;
+ }
DBGpBreakpoint bp = bpFacade.createDBGpBreakpoint(breakpoint);
if (isSuspended() || (asyncSupported && isRunning())) {
// aysnc mode and running or we are suspended so send the remove
@@ -2039,11 +2054,12 @@ public class DBGpTarget extends DBGpElement
if (!bmgr.isEnabled()) {
return;
}
- int deltaLNumber = delta.getAttribute(IMarker.LINE_NUMBER, 0);
- IMarker marker = breakpoint.getMarker();
- int lineNumber = marker.getAttribute(IMarker.LINE_NUMBER, 0);
if (supportsBreakpoint(breakpoint)) {
try {
+ int deltaLNumber = delta.getAttribute(IMarker.LINE_NUMBER, 0);
+ boolean deltaEnabled = delta.getAttribute(IBreakpoint.ENABLED, breakpoint.isEnabled());
+ IMarker marker = breakpoint.getMarker();
+ int lineNumber = marker.getAttribute(IMarker.LINE_NUMBER, 0);
// did the condition change ?
DBGpBreakpoint bp = bpFacade.createDBGpBreakpoint(breakpoint);
@@ -2054,9 +2070,9 @@ public class DBGpTarget extends DBGpElement
bp.resetConditionChanged();
if (breakpoint.isEnabled()) {
breakpointRemoved(breakpoint, null);
- } else {
- return;
+ breakpointAdded(breakpoint);
}
+ return;
}
// did the line number change ?
@@ -2067,17 +2083,33 @@ public class DBGpTarget extends DBGpElement
if (breakpoint.isEnabled()) {
breakpointRemoved(breakpoint, null);
+ breakpointAdded(breakpoint);
+ }
+ return;
+ }
+
+ // did the line enable state change ?
+ if (breakpoint.isEnabled() != deltaEnabled) {
+ if (DBGpLogger.debugBP()) {
+ DBGpLogger.debug("enable state changed for breakpoint with ID: " + bp.getID()); //$NON-NLS-1$
+ }
+
+ // enable or disable a breakpoint from the "Breakpoints" view
+ if (breakpoint.isEnabled()) {
+ breakpointAdded(breakpoint);
} else {
- return;
+ // force removal of this breakpoint
+ breakpointRemoved(breakpoint, false);
}
+ return;
}
// add or remove the break point depending on whether it was
// enabled or not
if (breakpoint.isEnabled()) {
- breakpointAdded(breakpoint);
- } else {
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=538315
breakpointRemoved(breakpoint, null);
+ breakpointAdded(breakpoint);
}
} catch (CoreException e) {
DBGpLogger.logException("Exception Changing Breakpoint", this, e); //$NON-NLS-1$
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 56aab8cdc..34f5ffef8 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation and others.
+ * Copyright (c) 2009, 2019 IBM Corporation and others.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
@@ -612,8 +612,20 @@ public class PHPDebugTarget extends PHPDebugElement
*/
@Override
public void breakpointRemoved(IBreakpoint breakpoint, IMarkerDelta delta) {
+ breakpointRemoved(breakpoint, true);
+ }
+
+ public void breakpointRemoved(IBreakpoint breakpoint, boolean onlyHandleEnabledBreakpoints) {
if (supportsBreakpoint(breakpoint)) {
- if (breakpoint instanceof PHPRunToLineBreakpoint) {
+ try {
+ if (onlyHandleEnabledBreakpoints && !breakpoint.isEnabled()) {
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=538315
+ // already handled by breakpointChanged(IBreakpoint, IMarkerDelta),
+ // nothing more to do
+ return;
+ }
+ } catch (CoreException e) {
+ Logger.logException("PHPDebugTarget: Exception Removing Breakpoint", e); //$NON-NLS-1$
return;
}
fLastcmd = "breakpointRemoved"; //$NON-NLS-1$
@@ -640,30 +652,41 @@ public class PHPDebugTarget extends PHPDebugElement
if (!fBreakpointManager.isEnabled()) {
return;
}
- int deltaLNumber = delta.getAttribute(IMarker.LINE_NUMBER, 0);
- IMarker marker = breakpoint.getMarker();
- int lineNumber = marker.getAttribute(IMarker.LINE_NUMBER, 0);
if (supportsBreakpoint(breakpoint)) {
try {
+ int deltaLNumber = delta.getAttribute(IMarker.LINE_NUMBER, 0);
+ boolean deltaEnabled = delta.getAttribute(IBreakpoint.ENABLED, breakpoint.isEnabled());
+ IMarker marker = breakpoint.getMarker();
+ int lineNumber = marker.getAttribute(IMarker.LINE_NUMBER, 0);
if (((PHPLineBreakpoint) breakpoint).isConditionChanged()) {
((PHPLineBreakpoint) breakpoint).setConditionChanged(false);
if (breakpoint.isEnabled()) {
breakpointRemoved(breakpoint, null);
- } else {
- return;
+ breakpointAdded(breakpoint);
}
+ return;
}
if (lineNumber != deltaLNumber) {
if (breakpoint.isEnabled()) {
breakpointRemoved(breakpoint, null);
+ breakpointAdded(breakpoint);
+ }
+ return;
+ }
+ if (breakpoint.isEnabled() != deltaEnabled) {
+ // enable or disable a breakpoint from the "Breakpoints" view
+ if (breakpoint.isEnabled()) {
+ breakpointAdded(breakpoint);
} else {
- return;
+ // force removal of this breakpoint
+ breakpointRemoved(breakpoint, false);
}
+ return;
}
if (breakpoint.isEnabled()) {
- breakpointAdded(breakpoint);
- } else {
+ // https://bugs.eclipse.org/bugs/show_bug.cgi?id=538315
breakpointRemoved(breakpoint, null);
+ breakpointAdded(breakpoint);
}
} catch (CoreException e) {
Logger.logException("PHPDebugTarget: Exception Changing Breakpoint", e); //$NON-NLS-1$

Back to the top