Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikhail Khodjaiants2011-09-15 21:17:37 +0000
committerMikhail Khodjaiants2011-09-15 21:17:37 +0000
commit1f971379691d4b19285fd8ada25959e2c146e4ab (patch)
treedd8ad652a3ea0df999ab2f4d602f824d57dd2ac2
parent980e5237e09e480daf51885152d44bb42d8f82fe (diff)
downloadorg.eclipse.cdt-1f971379691d4b19285fd8ada25959e2c146e4ab.tar.gz
org.eclipse.cdt-1f971379691d4b19285fd8ada25959e2c146e4ab.tar.xz
org.eclipse.cdt-1f971379691d4b19285fd8ada25959e2c146e4ab.zip
Bug 357515 - [breakpoints] Target filter is not working when unchecking
the entire target.
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java31
1 files changed, 27 insertions, 4 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java
index 40010e2f2a..029478e7ef 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java
@@ -17,6 +17,7 @@
package org.eclipse.cdt.dsf.mi.service;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Hashtable;
@@ -845,9 +846,9 @@ public class MIBreakpointsManager extends AbstractDsfService implements IBreakpo
final Map<ICBreakpoint, Set<String>> threadsIDs = fBreakpointThreads.get(dmc);
assert threadsIDs != null;
- // Minimal validation
- if (!platformBPs.containsKey(breakpoint)) {
- rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR, UNKNOWN_BREAKPOINT, null));
+ boolean filtered = isBreakpointEntirelyFiltered(dmc, breakpoint);
+
+ if (filtered && !platformBPs.containsKey(breakpoint)) {
rm.done();
return;
}
@@ -860,7 +861,7 @@ public class MIBreakpointsManager extends AbstractDsfService implements IBreakpo
// Note that Tracepoints are not affected by "skip-all"
boolean bpEnabled = attributes.get(ICBreakpoint.ENABLED).equals(true) &&
(breakpoint instanceof ICTracepoint || fBreakpointManager.isEnabled());
- if (bpEnabled) {
+ if (!filtered && bpEnabled) {
attributes.put(ATTR_DEBUGGER_PATH, NULL_STRING);
attributes.put(ATTR_THREAD_FILTER, extractThreads(dmc, breakpoint));
attributes.put(ATTR_THREAD_ID, NULL_STRING);
@@ -876,6 +877,11 @@ public class MIBreakpointsManager extends AbstractDsfService implements IBreakpo
}
return;
}
+
+ if (filtered) {
+ uninstallBreakpoint(dmc, breakpoint, rm );
+ return;
+ }
// Get the original breakpoint attributes
final Map<String,Object> original_attributes = platformBPs.get(breakpoint);
@@ -975,8 +981,11 @@ public class MIBreakpointsManager extends AbstractDsfService implements IBreakpo
protected void handleSuccess() {
// Get the list of new back-end breakpoints contexts
newTargetBPs.addAll(getData());
+ for (IBreakpointDMContext newRef : newTargetBPs)
+ targetBPs.put(newRef, breakpoint);
threadsIDs.put(breakpoint, newThreads);
for (final IBreakpointDMContext ref : oldTargetBPs) {
+ targetBPs.remove(ref);
decrementInstallCount(ref, breakpoint, // A tad early but it should work...
new RequestMonitor(getExecutor(), removeRM) {
@Override
@@ -1883,4 +1892,18 @@ public class MIBreakpointsManager extends AbstractDsfService implements IBreakpo
return !(breakpoint instanceof ICWatchpoint);
}
+ /**
+ * Returns whether the breakpoint is filtered for given target.
+ */
+ private boolean isBreakpointEntirelyFiltered(IBreakpointsTargetDMContext dmc, ICBreakpoint breakpoint) {
+ IContainerDMContext currentDmc = DMContexts.getAncestorOfType(dmc, IContainerDMContext.class);
+ try {
+ IContainerDMContext[] targetDmcs = getFilterExtension(breakpoint).getTargetFilters();
+ if (Arrays.asList(targetDmcs).contains(currentDmc))
+ return false;
+ }
+ catch(CoreException e) {
+ }
+ return true;
+ }
}

Back to the top