Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFBreakpointScopeExtension.java48
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFAnnotationManager.java14
2 files changed, 35 insertions, 27 deletions
diff --git a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFBreakpointScopeExtension.java b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFBreakpointScopeExtension.java
index d73845682..e46fe00ca 100644
--- a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFBreakpointScopeExtension.java
+++ b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/breakpoints/TCFBreakpointScopeExtension.java
@@ -13,7 +13,6 @@ package org.eclipse.tcf.internal.cdt.ui.breakpoints;
import org.eclipse.cdt.debug.core.model.ICBreakpoint;
import org.eclipse.cdt.debug.core.model.ICBreakpointExtension;
import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
@@ -38,32 +37,29 @@ public class TCFBreakpointScopeExtension implements ICBreakpointExtension {
public void setThreadFilter(String[] threadIds) {
fContextIds = threadIds;
if (fBreakpoint == null) return;
- final IMarker m = fBreakpoint.getMarker();
- if (m == null || !m.exists()) return;
- String contextIdAttr = null;
- if (threadIds != null) {
- if (threadIds.length == 0) {
- // empty string is filtered out in TCFBreakpointsModel
- contextIdAttr = " ";
- }
- else {
- StringBuilder buf = new StringBuilder();
- for (int i = 0; i < threadIds.length - 1; i++) {
- buf.append(threadIds[i]).append(',');
- }
- buf.append(threadIds[threadIds.length - 1]);
- contextIdAttr = buf.toString();
- }
- }
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- final String IDAttr = contextIdAttr;
- IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- m.setAttribute(TCFBreakpointsModel.ATTR_CONTEXTIDS, IDAttr);
- }
- };
try {
- workspace.run(runnable, null);
+ ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
+ public void run(IProgressMonitor monitor) throws CoreException {
+ final IMarker m = fBreakpoint.getMarker();
+ if (m == null || !m.exists()) return;
+ String attr = null;
+ if (fContextIds != null) {
+ if (fContextIds.length == 0) {
+ // empty string is filtered out in TCFBreakpointsModel
+ attr = " ";
+ }
+ else {
+ StringBuilder buf = new StringBuilder();
+ for (int i = 0; i < fContextIds.length - 1; i++) {
+ buf.append(fContextIds[i]).append(',');
+ }
+ buf.append(fContextIds[fContextIds.length - 1]);
+ attr = buf.toString();
+ }
+ }
+ m.setAttribute(TCFBreakpointsModel.ATTR_CONTEXTIDS, attr);
+ }
+ }, null);
}
catch (Exception e) {
Activator.log(e);
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFAnnotationManager.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFAnnotationManager.java
index 0eaefd605..6140716de 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFAnnotationManager.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFAnnotationManager.java
@@ -17,8 +17,11 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
@@ -626,7 +629,16 @@ public class TCFAnnotationManager {
if (update_task != win_info.update_task) return;
assert win_info.update_node == node;
win_info.update_task = null;
- updateAnnotations(window, node, res);
+ try {
+ ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
+ public void run(IProgressMonitor monitor) throws CoreException {
+ updateAnnotations(window, node, res);
+ }
+ }, null);
+ }
+ catch (Exception e) {
+ Activator.log(e);
+ }
}
});
}

Back to the top