mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 357515 - [breakpoints] Target filter is not working when unchecking
the entire target.
This commit is contained in:
parent
88411c52f8
commit
e3bb6338ba
1 changed files with 27 additions and 4 deletions
|
@ -17,6 +17,7 @@
|
||||||
package org.eclipse.cdt.dsf.mi.service;
|
package org.eclipse.cdt.dsf.mi.service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Hashtable;
|
import java.util.Hashtable;
|
||||||
|
@ -845,9 +846,9 @@ public class MIBreakpointsManager extends AbstractDsfService implements IBreakpo
|
||||||
final Map<ICBreakpoint, Set<String>> threadsIDs = fBreakpointThreads.get(dmc);
|
final Map<ICBreakpoint, Set<String>> threadsIDs = fBreakpointThreads.get(dmc);
|
||||||
assert threadsIDs != null;
|
assert threadsIDs != null;
|
||||||
|
|
||||||
// Minimal validation
|
boolean filtered = isBreakpointEntirelyFiltered(dmc, breakpoint);
|
||||||
if (!platformBPs.containsKey(breakpoint)) {
|
|
||||||
rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR, UNKNOWN_BREAKPOINT, null));
|
if (filtered && !platformBPs.containsKey(breakpoint)) {
|
||||||
rm.done();
|
rm.done();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -860,7 +861,7 @@ public class MIBreakpointsManager extends AbstractDsfService implements IBreakpo
|
||||||
// Note that Tracepoints are not affected by "skip-all"
|
// Note that Tracepoints are not affected by "skip-all"
|
||||||
boolean bpEnabled = attributes.get(ICBreakpoint.ENABLED).equals(true) &&
|
boolean bpEnabled = attributes.get(ICBreakpoint.ENABLED).equals(true) &&
|
||||||
(breakpoint instanceof ICTracepoint || fBreakpointManager.isEnabled());
|
(breakpoint instanceof ICTracepoint || fBreakpointManager.isEnabled());
|
||||||
if (bpEnabled) {
|
if (!filtered && bpEnabled) {
|
||||||
attributes.put(ATTR_DEBUGGER_PATH, NULL_STRING);
|
attributes.put(ATTR_DEBUGGER_PATH, NULL_STRING);
|
||||||
attributes.put(ATTR_THREAD_FILTER, extractThreads(dmc, breakpoint));
|
attributes.put(ATTR_THREAD_FILTER, extractThreads(dmc, breakpoint));
|
||||||
attributes.put(ATTR_THREAD_ID, NULL_STRING);
|
attributes.put(ATTR_THREAD_ID, NULL_STRING);
|
||||||
|
@ -877,6 +878,11 @@ public class MIBreakpointsManager extends AbstractDsfService implements IBreakpo
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (filtered) {
|
||||||
|
uninstallBreakpoint(dmc, breakpoint, rm );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Get the original breakpoint attributes
|
// Get the original breakpoint attributes
|
||||||
final Map<String,Object> original_attributes = platformBPs.get(breakpoint);
|
final Map<String,Object> original_attributes = platformBPs.get(breakpoint);
|
||||||
if (original_attributes == null) {
|
if (original_attributes == null) {
|
||||||
|
@ -975,8 +981,11 @@ public class MIBreakpointsManager extends AbstractDsfService implements IBreakpo
|
||||||
protected void handleSuccess() {
|
protected void handleSuccess() {
|
||||||
// Get the list of new back-end breakpoints contexts
|
// Get the list of new back-end breakpoints contexts
|
||||||
newTargetBPs.addAll(getData());
|
newTargetBPs.addAll(getData());
|
||||||
|
for (IBreakpointDMContext newRef : newTargetBPs)
|
||||||
|
targetBPs.put(newRef, breakpoint);
|
||||||
threadsIDs.put(breakpoint, newThreads);
|
threadsIDs.put(breakpoint, newThreads);
|
||||||
for (final IBreakpointDMContext ref : oldTargetBPs) {
|
for (final IBreakpointDMContext ref : oldTargetBPs) {
|
||||||
|
targetBPs.remove(ref);
|
||||||
decrementInstallCount(ref, breakpoint, // A tad early but it should work...
|
decrementInstallCount(ref, breakpoint, // A tad early but it should work...
|
||||||
new RequestMonitor(getExecutor(), removeRM) {
|
new RequestMonitor(getExecutor(), removeRM) {
|
||||||
@Override
|
@Override
|
||||||
|
@ -1883,4 +1892,18 @@ public class MIBreakpointsManager extends AbstractDsfService implements IBreakpo
|
||||||
return !(breakpoint instanceof ICWatchpoint);
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue