1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

[246735] - Additional fixes for thread filter logic.

This commit is contained in:
Pawel Piech 2008-11-13 19:55:09 +00:00
parent de5c1809ac
commit a3e5c5fbd5

View file

@ -1502,6 +1502,7 @@ public class MIBreakpointsManager extends AbstractDsfService implements IBreakpo
* @return * @return
*/ */
private Set<String> extractThreads(IBreakpointsTargetDMContext context, ICBreakpoint breakpoint) { private Set<String> extractThreads(IBreakpointsTargetDMContext context, ICBreakpoint breakpoint) {
Set<String> results = new HashSet<String>();
// Find the ancestor // Find the ancestor
List<IExecutionDMContext[]> threads = new ArrayList<IExecutionDMContext[]>(1); List<IExecutionDMContext[]> threads = new ArrayList<IExecutionDMContext[]>(1);
@ -1511,16 +1512,11 @@ public class MIBreakpointsManager extends AbstractDsfService implements IBreakpo
IDsfBreakpointExtension filterExtension = getFilterExtension(breakpoint); IDsfBreakpointExtension filterExtension = getFilterExtension(breakpoint);
IContainerDMContext[] targets = filterExtension.getTargetFilters(); IContainerDMContext[] targets = filterExtension.getTargetFilters();
// If no target is present, plant one... // If no target is present, breakpoint applies to all.
// if (targets.length == 0) { if (targets.length == 0) {
// for (IBreakpointsTargetDMContext dmc : fPlatformBPs.keySet()) { results.add("0"); //$NON-NLS-1$
// IContainerDMContext ctx = DMContexts.getAncestorOfType(dmc, IContainerDMContext.class); return results;
// if (ctx == targetContext) { }
// filterExtension.setTargetFilter(ctx);
// targets = filterExtension.getTargetFilters();
// }
// }
// }
// Extract the thread IDs (if there is none, we are covered) // Extract the thread IDs (if there is none, we are covered)
for (IContainerDMContext ctxt : targets) { for (IContainerDMContext ctxt : targets) {
@ -1531,14 +1527,18 @@ public class MIBreakpointsManager extends AbstractDsfService implements IBreakpo
} catch (CoreException e1) { } catch (CoreException e1) {
} }
Set<String> results = new HashSet<String>();
if (supportsThreads(breakpoint)) { if (supportsThreads(breakpoint)) {
for (IExecutionDMContext[] targetThreads : threads) { for (IExecutionDMContext[] targetThreads : threads) {
for (IExecutionDMContext thread : targetThreads) { if (targetThreads != null) {
if (thread instanceof IMIExecutionDMContext) { for (IExecutionDMContext thread : targetThreads) {
IMIExecutionDMContext dmc = (IMIExecutionDMContext) thread; if (thread instanceof IMIExecutionDMContext) {
results.add(((Integer) dmc.getThreadId()).toString()); IMIExecutionDMContext dmc = (IMIExecutionDMContext) thread;
results.add(((Integer) dmc.getThreadId()).toString());
}
} }
} else {
results.add("0"); //$NON-NLS-1$
break;
} }
} }
} else { } else {