Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2013-01-17 00:23:48 -0500
committerEugene Tarassov2013-01-17 00:23:48 -0500
commitf8cf1f38668bbbff23beff1cde50112cc7bac852 (patch)
treeb97d2db2b9bb319eb47100da5cc3367d873cb3d2 /plugins
parent1cf737a2cd4beaa3dabb1bb0ac2449281d3341ac (diff)
downloadorg.eclipse.tcf-f8cf1f38668bbbff23beff1cde50112cc7bac852.tar.gz
org.eclipse.tcf-f8cf1f38668bbbff23beff1cde50112cc7bac852.tar.xz
org.eclipse.tcf-f8cf1f38668bbbff23beff1cde50112cc7bac852.zip
TCF Debugger: better handling of breakpoint status annotations
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/disassembly/TCFDisassemblyBackend.java2
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFAnnotationManager.java16
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java26
3 files changed, 31 insertions, 13 deletions
diff --git a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/disassembly/TCFDisassemblyBackend.java b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/disassembly/TCFDisassemblyBackend.java
index 0d9c15f05..51068758a 100644
--- a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/disassembly/TCFDisassemblyBackend.java
+++ b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/disassembly/TCFDisassemblyBackend.java
@@ -799,6 +799,7 @@ public class TCFDisassemblyBackend extends AbstractDisassemblyBackend {
fCallback.unlockScroller();
fCallback.doPending();
fCallback.updateVisibleArea();
+ request.ctx.getModel().updateAnnotations(fCallback.getSite().getWorkbenchWindow());
}
else {
fCallback.unlockScroller();
@@ -814,6 +815,7 @@ public class TCFDisassemblyBackend extends AbstractDisassemblyBackend {
fCallback.unlockScroller();
fCallback.doPending();
fCallback.updateVisibleArea();
+ request.ctx.getModel().updateAnnotations(fCallback.getSite().getWorkbenchWindow());
}
private void insertEmptySpace(Request request, BigInteger startAddress, BigInteger endAddress) {
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 a82e00f24..f8709579c 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
@@ -522,15 +522,18 @@ public class TCFAnnotationManager {
a.dispose();
i.remove();
}
- if (set == null || set.size() == 0) return;
- win_info.annotations.addAll(set);
+ if (set != null) win_info.annotations.addAll(set);
ISourcePresentation presentation = TCFModelPresentation.getDefault();
// Disassembly views
- for (TCFAnnotation a : set) {
+ for (TCFAnnotation a : win_info.annotations) {
if (a.addr == null) continue;
for (ITCFDisassemblyPart disasm : views.values()) {
IAnnotationModel ann_model = disasm.getAnnotationModel();
if (ann_model == null) continue;
+ if (a.models.contains(ann_model)) {
+ ann_model.removeAnnotation(a);
+ a.models.remove(ann_model);
+ }
Position p = disasm.getAddressPosition(a.addr);
if (p == null) continue;
if (a.breakpoint != null && hidePlantingAnnotation(ann_model, a.breakpoint, p)) continue;
@@ -539,7 +542,7 @@ public class TCFAnnotationManager {
}
}
// Disassembly editor
- for (TCFAnnotation a : set) {
+ for (TCFAnnotation a : win_info.annotations) {
if (a.addr == null) continue;
IEditorPart editor = editors.get(TCFModel.DisassemblyEditorInput.INSTANCE);
if (editor == null) continue;
@@ -547,6 +550,10 @@ public class TCFAnnotationManager {
if (disasm == null) continue;
IAnnotationModel ann_model = disasm.getAnnotationModel();
if (ann_model == null) continue;
+ if (a.models.contains(ann_model)) {
+ ann_model.removeAnnotation(a);
+ a.models.remove(ann_model);
+ }
Position p = disasm.getAddressPosition(a.addr);
if (p == null) continue;
if (a.breakpoint != null && hidePlantingAnnotation(ann_model, a.breakpoint, p)) continue;
@@ -554,6 +561,7 @@ public class TCFAnnotationManager {
a.models.add(ann_model);
}
// Source editors
+ if (set == null) return;
for (TCFAnnotation a : set) {
Object source_element = TCFSourceLookupDirector.lookup(node.launch, a.ctx, a.area);
if (source_element == null) continue;
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java
index 7ff893670..b1443ccb2 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java
@@ -374,7 +374,7 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
((TCFNodeExecContext)node).onContainerResumed();
}
}
- annotation_manager.updateAnnotations(null, launch);
+ updateAnnotations(null);
}
public void containerSuspended(String context, String pc, String reason,
@@ -401,7 +401,7 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
launch_node.onAnyContextSuspendedOrChanged();
if (!func_call && action_cnt == 0) {
setDebugViewSelection(node, reason);
- annotation_manager.updateAnnotations(null, launch);
+ updateAnnotations(null);
TCFNodePropertySource.refresh(node);
}
action_results.remove(context);
@@ -456,7 +456,7 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
if (node instanceof TCFNodeExecContext) {
((TCFNodeExecContext)node).onContextResumed();
}
- annotation_manager.updateAnnotations(null, launch);
+ updateAnnotations(null);
}
public void contextSuspended(String id, String pc, String reason, Map<String,Object> params) {
@@ -473,7 +473,7 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
launch_node.onAnyContextSuspendedOrChanged();
if (!func_call && active_actions.get(id) == null) {
setDebugViewSelection(node, reason);
- annotation_manager.updateAnnotations(null, launch);
+ updateAnnotations(null);
TCFNodePropertySource.refresh(node);
}
onMemoryChanged(id, false, true);
@@ -568,7 +568,7 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
public void onContextActionStart(TCFAction action) {
final String id = action.getContextID();
active_actions.put(id, action);
- annotation_manager.updateAnnotations(null, launch);
+ updateAnnotations(null);
}
public void onContextActionResult(String id, String reason) {
@@ -599,7 +599,7 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
}
}
for (TCFModelProxy p : model_proxies) p.post();
- annotation_manager.updateAnnotations(null, launch);
+ updateAnnotations(null);
TCFNodePropertySource.refresh(node);
}
launch.removePendingClient(this);
@@ -960,11 +960,11 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
launch_node.onAnyContextAddedOrRemoved();
// Close debug session if the last context is removed:
onContextOrProcessRemoved();
- annotation_manager.updateAnnotations(null, launch);
+ updateAnnotations(null);
}
void onContextRunning() {
- annotation_manager.updateAnnotations(null, launch);
+ updateAnnotations(null);
}
Map<String,Object> getContextMap() {
@@ -1621,6 +1621,14 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
proxy.setSelection(node);
}
+ /**
+ * Update debugger annotations in a workbench window.
+ * @param window - workbench window, null means update all windows.
+ */
+ public void updateAnnotations(IWorkbenchWindow window) {
+ annotation_manager.updateAnnotations(window, launch);
+ }
+
private synchronized Object displaySourceStart(IWorkbenchPage page, boolean wait) {
Object generation = new Object();
if (wait) launch.addPendingClient(generation);
@@ -1810,7 +1818,7 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
if (!displaySourceCheck(page, generation)) return;
displaySource(page, editor_id, editor_input, line);
if (wait_for_pc_update_after_step) launch.addPendingClient(annotation_manager);
- annotation_manager.updateAnnotations(page.getWorkbenchWindow(), launch);
+ updateAnnotations(page.getWorkbenchWindow());
}
finally {
displaySourceEnd(generation);

Back to the top