Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2013-01-16 20:02:54 +0000
committerEugene Tarassov2013-01-16 20:02:54 +0000
commit8520567c14dca436b5dd77479bba029cdf99f359 (patch)
treef40dcd7ed51a5f90578cf90663c9553e62ac61e5 /plugins/org.eclipse.tcf.cdt.ui
parent83977c0e284a4523ce02ec35a0d3c411775353b2 (diff)
downloadorg.eclipse.tcf-8520567c14dca436b5dd77479bba029cdf99f359.tar.gz
org.eclipse.tcf-8520567c14dca436b5dd77479bba029cdf99f359.tar.xz
org.eclipse.tcf-8520567c14dca436b5dd77479bba029cdf99f359.zip
TCF Debugger: fixed breakpoint status annotations in disassembly editor and views
Diffstat (limited to 'plugins/org.eclipse.tcf.cdt.ui')
-rw-r--r--plugins/org.eclipse.tcf.cdt.ui/plugin.xml15
-rw-r--r--plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/DisassemblyPartAdapterFactory.java57
2 files changed, 67 insertions, 5 deletions
diff --git a/plugins/org.eclipse.tcf.cdt.ui/plugin.xml b/plugins/org.eclipse.tcf.cdt.ui/plugin.xml
index 7b3e3dea0..6a046e643 100644
--- a/plugins/org.eclipse.tcf.cdt.ui/plugin.xml
+++ b/plugins/org.eclipse.tcf.cdt.ui/plugin.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?><!--
- Copyright (c) 2010 Wind River Systems, Inc. and others.
+ Copyright (c) 2013 Wind River Systems, Inc. and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
@@ -12,10 +12,10 @@
<plugin>
- <extension point="org.eclipse.tcf.debug.ui.launch_context">
- <class name="org.eclipse.tcf.internal.cdt.ui.TCFLaunchContext" />
- </extension>
-
+ <extension point="org.eclipse.tcf.debug.ui.launch_context">
+ <class name="org.eclipse.tcf.internal.cdt.ui.TCFLaunchContext" />
+ </extension>
+
<extension
point="org.eclipse.core.runtime.adapters">
<factory
@@ -34,6 +34,11 @@
<adapter type="org.eclipse.cdt.debug.core.ICWatchpointTarget"/>
<adapter type="org.eclipse.tcf.internal.debug.ui.model.ISourceNotFoundPresentation"/>
</factory>
+ <factory
+ adaptableType="org.eclipse.cdt.dsf.debug.internal.ui.disassembly.DisassemblyPart"
+ class="org.eclipse.tcf.internal.cdt.ui.DisassemblyPartAdapterFactory">
+ <adapter type="org.eclipse.tcf.internal.debug.ui.model.ITCFDisassemblyPart"/>
+ </factory>
</extension>
<extension
diff --git a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/DisassemblyPartAdapterFactory.java b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/DisassemblyPartAdapterFactory.java
new file mode 100644
index 000000000..8a40e1e12
--- /dev/null
+++ b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/DisassemblyPartAdapterFactory.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Xilinx, Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Xilinx - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.internal.cdt.ui;
+
+import java.math.BigInteger;
+
+import org.eclipse.cdt.debug.internal.ui.disassembly.dsf.AddressRangePosition;
+import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.DisassemblyPart;
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.source.IAnnotationModel;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.tcf.internal.debug.ui.model.ITCFDisassemblyPart;
+
+@SuppressWarnings({ "rawtypes", "restriction" })
+public class DisassemblyPartAdapterFactory implements IAdapterFactory {
+
+ private static final Class<?>[] CLASSES = {
+ ITCFDisassemblyPart.class,
+ };
+
+ public Object getAdapter(Object obj, Class type) {
+ if (obj instanceof DisassemblyPart) {
+ final DisassemblyPart dpart = (DisassemblyPart)obj;
+ if (type == ITCFDisassemblyPart.class) {
+ return new ITCFDisassemblyPart() {
+ @Override
+ public IAnnotationModel getAnnotationModel() {
+ ISourceViewer viewer = dpart.getTextViewer();
+ if (viewer == null) return null;
+ return viewer.getAnnotationModel();
+ }
+
+ @Override
+ public Position getAddressPosition(BigInteger addr) {
+ AddressRangePosition pos = dpart.getPositionOfAddress(addr);
+ if (pos != null) return new Position(pos.offset, Math.max(0, pos.length-1));
+ return null;
+ }
+ };
+ }
+ }
+ return null;
+ }
+
+ public Class[] getAdapterList() {
+ return CLASSES;
+ }
+}

Back to the top