Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreutarass2008-04-25 18:39:50 +0000
committereutarass2008-04-25 18:39:50 +0000
commit1385e5e84da91b77f0ac875d25a80a3fe6490c82 (patch)
tree034b344acd4e7c18fa76cc5de1b492bf1bd6ad26 /plugins/org.eclipse.tm.tcf.debug
parent3be680f61e65a1481bb83537704751d3ff024b2d (diff)
downloadorg.eclipse.tcf-1385e5e84da91b77f0ac875d25a80a3fe6490c82.tar.gz
org.eclipse.tcf-1385e5e84da91b77f0ac875d25a80a3fe6490c82.tar.xz
org.eclipse.tcf-1385e5e84da91b77f0ac875d25a80a3fe6490c82.zip
Bug 227874: [tcf][api] breakpoint event and capabilities changes
Diffstat (limited to 'plugins/org.eclipse.tm.tcf.debug')
-rw-r--r--plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFBreakpointsModel.java8
-rw-r--r--plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFBreakpointsStatus.java42
2 files changed, 28 insertions, 22 deletions
diff --git a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFBreakpointsModel.java b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFBreakpointsModel.java
index ee091ca4e..7993267f4 100644
--- a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFBreakpointsModel.java
+++ b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFBreakpointsModel.java
@@ -195,7 +195,6 @@ public class TCFBreakpointsModel implements IBreakpointListener, IBreakpointMana
done = new IBreakpoints.DoneCommand() {
public void doneCommand(IToken token, Exception error) {
if (error != null) channel.terminate(error);
- else done(launch);
}
};
update();
@@ -210,9 +209,6 @@ public class TCFBreakpointsModel implements IBreakpointListener, IBreakpointMana
});
};
- void done(TCFLaunch launch) {
- }
-
abstract void update();
}
@@ -297,10 +293,6 @@ public class TCFBreakpointsModel implements IBreakpointListener, IBreakpointMana
void update() {
service.remove(new String[]{ (String)tcf_attrs.get(PROP_ID) }, done);
}
- @Override
- void done(TCFLaunch launch) {
- launch.getBreakpointsStatus().removeStatus((String)tcf_attrs.get(PROP_ID));
- }
}.exec();
}
catch (Throwable x) {
diff --git a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFBreakpointsStatus.java b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFBreakpointsStatus.java
index aeed30228..0785e2050 100644
--- a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFBreakpointsStatus.java
+++ b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFBreakpointsStatus.java
@@ -27,7 +27,6 @@ public class TCFBreakpointsStatus {
private final IBreakpoints service;
private final Map<String,Map<String,Object>> status = new HashMap<String,Map<String,Object>>();
private final Set<ITCFBreakpointListener> listeners = new HashSet<ITCFBreakpointListener>();
- private final Set<String> removed = new HashSet<String>();
private static final Map<String,Object> status_not_supported = new HashMap<String,Object>();
@@ -41,26 +40,49 @@ public class TCFBreakpointsStatus {
if (service != null) {
service.addListener(new IBreakpoints.BreakpointsListener() {
- public void breakpointStatusChanged(String id, Map<String, Object> status) {
+ public void breakpointStatusChanged(String id, Map<String,Object> m) {
assert Protocol.isDispatchThread();
- if (removed.contains(id)) return;
- TCFBreakpointsStatus.this.status.put(id, status);
+ if (status.get(id) == null) return;
+ status.put(id, m);
for (Iterator<ITCFBreakpointListener> i = listeners.iterator(); i.hasNext();) {
i.next().breakpointStatusChanged(id);
}
}
+
+ public void contextAdded(Map<String,Object>[] bps) {
+ for (Map<String,Object> bp : bps) {
+ String id = (String)bp.get(IBreakpoints.PROP_ID);
+ if (status.get(id) != null) continue;
+ status.put(id, new HashMap<String,Object>());
+ for (Iterator<ITCFBreakpointListener> i = listeners.iterator(); i.hasNext();) {
+ i.next().breakpointStatusChanged(id);
+ }
+ }
+ }
+
+ public void contextChanged(Map<String,Object>[] bps) {
+ }
+
+ public void contextRemoved(String[] ids) {
+ for (String id : ids) {
+ if (status.remove(id) == null) continue;
+ for (Iterator<ITCFBreakpointListener> i = listeners.iterator(); i.hasNext();) {
+ i.next().breakpointRemoved(id);
+ }
+ }
+ }
});
}
}
- public Map<String, Object> getStatus(String id) {
+ public Map<String,Object> getStatus(String id) {
assert id != null;
assert Protocol.isDispatchThread();
if (service == null) return status_not_supported;
return status.get(id);
}
- public Map<String, Object> getStatus(IBreakpoint bp) {
+ public Map<String,Object> getStatus(IBreakpoint bp) {
if (!bp.getModelIdentifier().equals(ITCFConstants.ID_TCF_DEBUG_MODEL)) return status_not_supported;
IMarker marker = bp.getMarker();
if (marker == null) return null;
@@ -68,14 +90,6 @@ public class TCFBreakpointsStatus {
ITCFConstants.ID_TCF_DEBUG_MODEL + '.' + IBreakpoints.PROP_ID, null));
}
- public void removeStatus(String id) {
- status.remove(id);
- removed.add(id);
- for (Iterator<ITCFBreakpointListener> i = listeners.iterator(); i.hasNext();) {
- i.next().breakpointRemoved(id);
- }
- }
-
public void addListener(ITCFBreakpointListener listener) {
assert Protocol.isDispatchThread();
listeners.add(listener);

Back to the top