Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreutarass2011-06-30 20:54:27 +0000
committereutarass2011-06-30 20:54:27 +0000
commit5b11c386f9cfa5dccf566cfc2229a29da07ba4b9 (patch)
tree1f46b2bcbdc9b211aa5e8fb8fc57d71eec1d8cb9 /plugins/org.eclipse.tm.tcf.debug
parentc1034860084e94449896dc6097edcc64e1438fc3 (diff)
downloadorg.eclipse.tcf-5b11c386f9cfa5dccf566cfc2229a29da07ba4b9.tar.gz
org.eclipse.tcf-5b11c386f9cfa5dccf566cfc2229a29da07ba4b9.tar.xz
org.eclipse.tcf-5b11c386f9cfa5dccf566cfc2229a29da07ba4b9.zip
TCF Debugger: implemented editor markers that show breakpoints status for current selection in the Debug view.
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/launch/TCFSourceLookupParticipant.java2
-rw-r--r--plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFBreakpointsStatus.java27
2 files changed, 21 insertions, 8 deletions
diff --git a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/launch/TCFSourceLookupParticipant.java b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/launch/TCFSourceLookupParticipant.java
index b6125ae5e..3e3d289c1 100644
--- a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/launch/TCFSourceLookupParticipant.java
+++ b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/launch/TCFSourceLookupParticipant.java
@@ -125,7 +125,7 @@ public class TCFSourceLookupParticipant extends AbstractSourceLookupParticipant
int j = name.lastIndexOf('\\');
if (i > j) base = name.substring(i + 1);
if (j > i) base = name.substring(j + 1);
- res = super.findSourceElements(base);
+ if (!base.equals(name)) res = super.findSourceElements(base);
}
}
ArrayList<Object> list = new ArrayList<Object>();
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 a41b1d9fe..bf73c1938 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
@@ -26,6 +26,7 @@ import org.eclipse.tm.tcf.services.IBreakpoints;
public class TCFBreakpointsStatus {
private final IBreakpoints service;
+ private final Map<String,Map<String,Object>> breakpoints = new HashMap<String,Map<String,Object>>();
private final Map<String,Map<String,Object>> status = new HashMap<String,Map<String,Object>>();
private final Set<ITCFBreakpointListener> listeners = new HashSet<ITCFBreakpointListener>();
@@ -53,6 +54,7 @@ public class TCFBreakpointsStatus {
public void contextAdded(Map<String,Object>[] bps) {
for (Map<String,Object> bp : bps) {
String id = (String)bp.get(IBreakpoints.PROP_ID);
+ breakpoints.put(id, bp);
if (status.get(id) != null) continue;
status.put(id, new HashMap<String,Object>());
for (Iterator<ITCFBreakpointListener> i = listeners.iterator(); i.hasNext();) {
@@ -64,6 +66,7 @@ public class TCFBreakpointsStatus {
public void contextChanged(Map<String,Object>[] bps) {
for (Map<String,Object> bp : bps) {
String id = (String)bp.get(IBreakpoints.PROP_ID);
+ breakpoints.put(id, bp);
if (!status.containsKey(id)) continue;
for (Iterator<ITCFBreakpointListener> i = listeners.iterator(); i.hasNext();) {
i.next().breakpointChanged(id);
@@ -73,6 +76,7 @@ public class TCFBreakpointsStatus {
public void contextRemoved(String[] ids) {
for (String id : ids) {
+ breakpoints.remove(id);
if (!status.containsKey(id)) continue;
for (Iterator<ITCFBreakpointListener> i = listeners.iterator(); i.hasNext();) {
i.next().breakpointRemoved(id);
@@ -89,13 +93,16 @@ public class TCFBreakpointsStatus {
public void doneGetIDs(IToken token, Exception error, String[] ids) {
if (error != null) return;
for (final String id : ids) {
- // fake properties - only ID is required for contextAdded
- Map<String, Object> bpProps = new HashMap<String, Object>();
- bpProps.put(IBreakpoints.PROP_ID, id);
- listener.contextAdded((Map<String, Object>[]) new Map[] { bpProps });
- service.getStatus(id, new IBreakpoints.DoneGetStatus() {
- public void doneGetStatus(IToken token, Exception error, Map<String, Object> status) {
- if (error == null) listener.breakpointStatusChanged(id, status);
+ service.getProperties(id, new IBreakpoints.DoneGetProperties() {
+ public void doneGetProperties(IToken token, Exception error, Map<String, Object> props) {
+ if (error == null) {
+ listener.contextAdded((Map<String, Object>[]) new Map[] { props });
+ service.getStatus(id, new IBreakpoints.DoneGetStatus() {
+ public void doneGetStatus(IToken token, Exception error, Map<String, Object> status) {
+ if (error == null) listener.breakpointStatusChanged(id, status);
+ }
+ });
+ }
}
});
}
@@ -115,6 +122,12 @@ public class TCFBreakpointsStatus {
return status.get(id);
}
+ public Map<String,Object> getProperties(String id) {
+ assert id != null;
+ assert Protocol.isDispatchThread();
+ return breakpoints.get(id);
+ }
+
public Map<String,Object> getStatus(IBreakpoint bp) {
try {
String id = TCFBreakpointsModel.getBreakpointsModel().getBreakpointID(bp);

Back to the top