Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreutarass2008-06-05 22:41:36 +0000
committereutarass2008-06-05 22:41:36 +0000
commit81d6d2bfffbc7b2ab33cf9d6dc3938dfdd99f597 (patch)
treec0cad43ffba1462902dfdd18a0f8352229e52e65
parent72cddcac552c4ae7d945157e34bd5d737d6e801d (diff)
downloadorg.eclipse.tcf-81d6d2bfffbc7b2ab33cf9d6dc3938dfdd99f597.tar.gz
org.eclipse.tcf-81d6d2bfffbc7b2ab33cf9d6dc3938dfdd99f597.tar.xz
org.eclipse.tcf-81d6d2bfffbc7b2ab33cf9d6dc3938dfdd99f597.zip
1. Java and agent code updated to match latest Breakpoints service specifications.
2. Breakpoint status is implemented
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/ImageCache.java42
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/adapters/TCFLaunchLabelProvider.java2
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/commands/BreakpointCommand.java2
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/launch/PeerPropsDialog.java8
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/launch/TCFArgumentsTab.java30
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/launch/TCFMainTab.java36
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/launch/TCFSelfTest.java75
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFAnnotationManager.java2
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModelPresentation.java17
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExecContext.java12
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeRegister.java2
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeStackFrame.java4
-rw-r--r--plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFBreakpoint.java2
-rw-r--r--plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFBreakpointsModel.java6
-rw-r--r--plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFBreakpointsStatus.java15
-rw-r--r--plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFLaunch.java2
-rw-r--r--plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/services/TCFDSFBreakpoints.java20
-rw-r--r--plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/services/IBreakpoints.java73
18 files changed, 211 insertions, 139 deletions
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/ImageCache.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/ImageCache.java
index b97b06076..5d2af1706 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/ImageCache.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/ImageCache.java
@@ -18,15 +18,38 @@ import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
import org.osgi.framework.Bundle;
public class ImageCache {
+
+ public static final String
+ IMG_TCF = "icons/tcf.gif",
+ IMG_ARGUMENTS_TAB = "icons/arguments_tab.gif",
+ IMG_ATTRIBUTE = "icons/attribute.gif",
+
+ IMG_THREAD_TERMINATED = "icons/full/obj16/threadt_obj.gif",
+ IMG_THREAD_SUSPENDED = "icons/full/obj16/threads_obj.gif",
+ IMG_THREAD_RUNNNIG = "icons/full/obj16/thread_obj.gif",
+
+ IMG_PROCESS_TERMINATED = "icons/full/obj16/debugtt_obj.gif",
+ IMG_PROCESS_SUSPENDED = "icons/full/obj16/debugts_obj.gif",
+ IMG_PROCESS_RUNNING = "icons/full/obj16/debugt_obj.gif",
+
+ IMG_REGISTER = "icons/full/obj16/genericregister_obj.gif",
+
+ IMG_STACK_FRAME_SUSPENDED = "icons/full/obj16/stckframe_obj.gif",
+ IMG_STACK_FRAME_RUNNING = "icons/full/obj16/stckframe_running_obj.gif",
+
+ IMG_BREAKPOINT_ENABLED = "icons/full/obj16/brkp_obj.gif",
+ IMG_BREAKPOINT_DISABLED = "icons/full/obj16/brkpd_obj.gif";
- private static final Map<String,ImageDescriptor> image_cache = new HashMap<String,ImageDescriptor>();
+ private static final Map<String,ImageDescriptor> desc_cache = new HashMap<String,ImageDescriptor>();
+ private static final Map<ImageDescriptor,Image> image_cache = new HashMap<ImageDescriptor,Image>();
public static ImageDescriptor getImageDescriptor(String name) {
if (name == null) return null;
- ImageDescriptor descriptor = image_cache.get(name);
+ ImageDescriptor descriptor = desc_cache.get(name);
if (descriptor == null) {
Bundle bundle = Platform.getBundle(Activator.PLUGIN_ID);
if (bundle != null){
@@ -43,8 +66,21 @@ public class ImageCache {
if (descriptor == null) {
descriptor = ImageDescriptor.getMissingImageDescriptor();
}
- image_cache.put(name, descriptor);
+ desc_cache.put(name, descriptor);
}
return descriptor;
}
+
+ public static Image getImage(ImageDescriptor desc) {
+ Image image = image_cache.get(desc);
+ if (image == null) {
+ image = desc.createImage();
+ image_cache.put(desc, image);
+ }
+ return image;
+ }
+
+ public static Image getImage(String name) {
+ return getImage(getImageDescriptor(name));
+ }
}
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/adapters/TCFLaunchLabelProvider.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/adapters/TCFLaunchLabelProvider.java
index 2bf9f6a8d..3ffaf94b3 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/adapters/TCFLaunchLabelProvider.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/adapters/TCFLaunchLabelProvider.java
@@ -22,7 +22,7 @@ class TCFLaunchLabelProvider implements IElementLabelProvider {
for (int i = 0; i < updates.length; i++) {
ILabelUpdate result = updates[i];
TCFLaunch launch = (TCFLaunch)result.getElement();
- result.setImageDescriptor(ImageCache.getImageDescriptor("icons/tcf.gif"), 0);
+ result.setImageDescriptor(ImageCache.getImageDescriptor(ImageCache.IMG_TCF), 0);
String status = "";
if (launch.isConnecting()) status = "Connecting";
else if (launch.isDisconnected()) status = "Disconnected";
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/commands/BreakpointCommand.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/commands/BreakpointCommand.java
index fe914489b..fceba9f2d 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/commands/BreakpointCommand.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/commands/BreakpointCommand.java
@@ -58,7 +58,7 @@ public class BreakpointCommand implements IToggleBreakpointsTargetExtension {
if (addr == null) return;
Map<String,Object> m = new HashMap<String,Object>();
m.put(IBreakpoints.PROP_ENABLED, Boolean.TRUE);
- m.put(IBreakpoints.PROP_ADDRESS, addr);
+ m.put(IBreakpoints.PROP_LOCATION, addr);
new TCFBreakpoint(ResourcesPlugin.getWorkspace().getRoot(), m);
}
catch (CoreException x) {
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/launch/PeerPropsDialog.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/launch/PeerPropsDialog.java
index 8d5d8d60f..6891ba7f5 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/launch/PeerPropsDialog.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/launch/PeerPropsDialog.java
@@ -212,13 +212,7 @@ class PeerPropsDialog extends Dialog {
attr_table.setHeaderVisible(true);
attr_table.setLinesVisible(true);
- attr_image = ImageCache.getImageDescriptor("icons/attribute.gif").createImage();
- attr_table.addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent e) {
- attr_image.dispose();
- attr_image = null;
- }
- });
+ attr_image = ImageCache.getImage(ImageCache.IMG_ATTRIBUTE);
table_viewer = new TableViewer(attr_table);
table_viewer.setUseHashlookup(true);
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/launch/TCFArgumentsTab.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/launch/TCFArgumentsTab.java
index 84d16915b..23c43051b 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/launch/TCFArgumentsTab.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/launch/TCFArgumentsTab.java
@@ -10,16 +10,11 @@
*******************************************************************************/
package org.eclipse.tm.internal.tcf.debug.ui.launch;
-import java.net.URL;
-
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Path;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
import org.eclipse.debug.ui.StringVariableSelectionDialog;
-import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -34,7 +29,7 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Text;
import org.eclipse.tm.internal.tcf.debug.launch.TCFLaunchDelegate;
-import org.eclipse.tm.internal.tcf.debug.ui.Activator;
+import org.eclipse.tm.internal.tcf.debug.ui.ImageCache;
public class TCFArgumentsTab extends AbstractLaunchConfigurationTab {
@@ -43,7 +38,6 @@ public class TCFArgumentsTab extends AbstractLaunchConfigurationTab {
private Button button_variables;
private Text text_working_dir;
private Button button_default_dir;
- private Image image;
public void createControl(Composite parent) {
Font font = parent.getFont();
@@ -58,17 +52,6 @@ public class TCFArgumentsTab extends AbstractLaunchConfigurationTab {
createArgumentsGroup(comp);
createWorkingDirGroup(comp);
-
- URL url = FileLocator.find(Activator.getDefault().getBundle(),
- new Path("icons/arguments_tab.gif"), null);
- ImageDescriptor descriptor = null;
- if (url == null) {
- descriptor = ImageDescriptor.getMissingImageDescriptor();
- }
- else {
- descriptor = ImageDescriptor.createFromURL(url);
- }
- image = descriptor.createImage(parent.getDisplay());
}
private void createArgumentsGroup(Composite comp) {
@@ -122,15 +105,6 @@ public class TCFArgumentsTab extends AbstractLaunchConfigurationTab {
button_default_dir.setFont(font);
}
- @Override
- public void dispose() {
- if (image != null) {
- image.dispose();
- image = null;
- }
- super.dispose();
- }
-
/**
* A variable entry button has been pressed for the given text
* field. Prompt the user for a variable and enter the result
@@ -192,6 +166,6 @@ public class TCFArgumentsTab extends AbstractLaunchConfigurationTab {
@Override
public Image getImage() {
- return image;
+ return ImageCache.getImageDescriptor(ImageCache.IMG_ARGUMENTS_TAB).createImage();
}
}
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/launch/TCFMainTab.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/launch/TCFMainTab.java
index c7d700abc..15e723ff7 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/launch/TCFMainTab.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/launch/TCFMainTab.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.tm.internal.tcf.debug.ui.launch;
-import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
@@ -18,12 +17,9 @@ import java.util.Iterator;
import java.util.Map;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Path;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
-import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;
@@ -51,7 +47,7 @@ import org.eclipse.swt.widgets.TreeColumn;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.tm.internal.tcf.debug.launch.TCFLaunchDelegate;
import org.eclipse.tm.internal.tcf.debug.launch.TCFUserDefPeer;
-import org.eclipse.tm.internal.tcf.debug.ui.Activator;
+import org.eclipse.tm.internal.tcf.debug.ui.ImageCache;
import org.eclipse.tm.tcf.protocol.IChannel;
import org.eclipse.tm.tcf.protocol.IPeer;
import org.eclipse.tm.tcf.protocol.Protocol;
@@ -73,7 +69,6 @@ public class TCFMainTab extends AbstractLaunchConfigurationTab {
private Display display;
private final Map<LocatorListener,ILocator> listeners = new HashMap<LocatorListener,ILocator>();
- private final Map<String,Image> image_cache = new HashMap<String,Image>();
private static class PeerInfo {
PeerInfo parent;
@@ -476,8 +471,6 @@ public class TCFMainTab extends AbstractLaunchConfigurationTab {
display = null;
}
});
- for (Image i : image_cache.values()) i.dispose();
- image_cache.clear();
super.dispose();
}
@@ -487,7 +480,7 @@ public class TCFMainTab extends AbstractLaunchConfigurationTab {
@Override
public Image getImage() {
- return getImage("icons/tcf.gif");
+ return ImageCache.getImage(ImageCache.IMG_TCF);
}
public void initializeFrom(ILaunchConfiguration configuration) {
@@ -783,7 +776,7 @@ public class TCFMainTab extends AbstractLaunchConfigurationTab {
if (errors.size() > 0) {
shell.dispose();
new TestErrorsDialog(getControl().getShell(),
- getImage("icons/tcf.gif"), errors).open();
+ ImageCache.getImage(ImageCache.IMG_TCF), errors).open();
}
else if (loop && !b && display != null) {
runDiagnostics(item, true, test, shell, label, bar);
@@ -819,7 +812,7 @@ public class TCFMainTab extends AbstractLaunchConfigurationTab {
text[4] = info.attrs.get(IPeer.ATTR_IP_PORT);
item.setText(text);
item.setForeground(display.getSystemColor(SWT.COLOR_LIST_FOREGROUND));
- item.setImage(getImage(getImageName(info)));
+ item.setImage(ImageCache.getImage(getImageName(info)));
if (!canHaveChildren(info)) item.setItemCount(0);
else if (info.children == null || info.children_error != null) item.setItemCount(1);
else item.setItemCount(info.children.length);
@@ -830,26 +823,7 @@ public class TCFMainTab extends AbstractLaunchConfigurationTab {
return getPath(info.parent) + "/" + info.id;
}
- private Image getImage(String name) {
- if (name == null) return null;
- if (display == null) return null;
- Image image = image_cache.get(name);
- if (image == null) {
- URL url = FileLocator.find(Activator.getDefault().getBundle(), new Path(name), null);
- ImageDescriptor descriptor = null;
- if (url == null) {
- descriptor = ImageDescriptor.getMissingImageDescriptor();
- }
- else {
- descriptor = ImageDescriptor.createFromURL(url);
- }
- image = descriptor.createImage(display);
- image_cache.put(name, image);
- }
- return image;
- }
-
private String getImageName(PeerInfo info) {
- return "icons/tcf.gif";
+ return ImageCache.IMG_TCF;
}
}
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/launch/TCFSelfTest.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/launch/TCFSelfTest.java
index 2da503318..289a52f13 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/launch/TCFSelfTest.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/launch/TCFSelfTest.java
@@ -546,7 +546,6 @@ class TCFSelfTest {
}
}
- @SuppressWarnings("unchecked")
public void doneGetSymbol(IToken token, Throwable error, ISymbol symbol) {
if (error != null) {
exit(error);
@@ -574,44 +573,60 @@ class TCFSelfTest {
}
else {
array = symbol;
- Map<String,Object> m[] = new Map[4];
- for (int i = 0; i < m.length; i++) {
- m[i] = new HashMap();
- m[i].put(IBreakpoints.PROP_ID, "TcfTestBP" + i);
- m[i].put(IBreakpoints.PROP_ENABLED, Boolean.TRUE);
- switch (i) {
- case 0:
- m[i].put(IBreakpoints.PROP_ADDRESS, func0.getValue().toString());
- m[i].put(IBreakpoints.PROP_CONDITION, "$thread!=\"\"");
- break;
- case 1:
- m[i].put(IBreakpoints.PROP_ADDRESS, "(31+1)/16+tcf_test_func1-2");
- m[i].put(IBreakpoints.PROP_CONDITION, "tcf_test_func0!=tcf_test_func1");
- break;
- case 2:
- m[i].put(IBreakpoints.PROP_ADDRESS, "tcf_test_func2");
- m[i].put(IBreakpoints.PROP_ENABLED, Boolean.FALSE);
- break;
- case 3:
- m[i].put(IBreakpoints.PROP_ID, "TcfTestBP3" + channel_id);
- m[i].put(IBreakpoints.PROP_ENABLED, Boolean.FALSE);
- m[i].put(IBreakpoints.PROP_ADDRESS, "tcf_test_func2");
- break;
- }
- bp_list.put((String)m[i].get(IBreakpoints.PROP_ID), m[i]);
- }
- bp.set(m, new IBreakpoints.DoneCommand() {
+ // Reset breakpoint list (previous tests might left breakpoints)
+ bp.set(null, new IBreakpoints.DoneCommand() {
public void doneCommand(IToken token, Exception error) {
if (error != null) {
exit(error);
}
else {
- get_state_cmds.put(rc.getContext(context_id, TestRCBP1.this), context_id);
+ // Create initial set of breakpoints
+ iniBreakpoints();
}
}
});
}
}
+
+ @SuppressWarnings("unchecked")
+ private void iniBreakpoints() {
+ Map<String,Object> m[] = new Map[4];
+ for (int i = 0; i < m.length; i++) {
+ m[i] = new HashMap();
+ m[i].put(IBreakpoints.PROP_ID, "TcfTestBP" + i);
+ m[i].put(IBreakpoints.PROP_ENABLED, Boolean.TRUE);
+ switch (i) {
+ case 0:
+ m[i].put(IBreakpoints.PROP_LOCATION, func0.getValue().toString());
+ m[i].put(IBreakpoints.PROP_CONDITION, "$thread!=\"\"");
+ break;
+ case 1:
+ m[i].put(IBreakpoints.PROP_LOCATION, "(31+1)/16+tcf_test_func1-2");
+ m[i].put(IBreakpoints.PROP_CONDITION, "tcf_test_func0!=tcf_test_func1");
+ break;
+ case 2:
+ m[i].put(IBreakpoints.PROP_LOCATION, "tcf_test_func2");
+ m[i].put(IBreakpoints.PROP_ENABLED, Boolean.FALSE);
+ break;
+ case 3:
+ m[i].put(IBreakpoints.PROP_ID, "TcfTestBP3" + channel_id);
+ m[i].put(IBreakpoints.PROP_ENABLED, Boolean.FALSE);
+ m[i].put(IBreakpoints.PROP_LOCATION, "tcf_test_func2");
+ break;
+ }
+ bp_list.put((String)m[i].get(IBreakpoints.PROP_ID), m[i]);
+ }
+ bp.set(m, new IBreakpoints.DoneCommand() {
+ public void doneCommand(IToken token, Exception error) {
+ if (error != null) {
+ exit(error);
+ }
+ else {
+ get_state_cmds.put(rc.getContext(context_id, TestRCBP1.this), context_id);
+ }
+ }
+ });
+ }
public void doneGetContext(IToken token, Exception error, RunControlContext context) {
get_state_cmds.remove(token);
@@ -716,7 +731,7 @@ class TCFSelfTest {
final Map<String,Object> m = new HashMap<String,Object>();
m.put(IBreakpoints.PROP_ID, bp_id);
m.put(IBreakpoints.PROP_ENABLED, Boolean.FALSE);
- m.put(IBreakpoints.PROP_ADDRESS, "tcf_test_func2");
+ m.put(IBreakpoints.PROP_LOCATION, "tcf_test_func2");
StringBuffer bf = new StringBuffer();
for (String id : threads.keySet()) {
if (bf.length() > 0) bf.append(" || ");
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFAnnotationManager.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFAnnotationManager.java
index a5e63d9d8..592f06501 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFAnnotationManager.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFAnnotationManager.java
@@ -273,7 +273,7 @@ public class TCFAnnotationManager {
if (map != null) {
String status = null;
String error = (String)map.get(IBreakpoints.STATUS_ERROR);
- Object planted = map.get(IBreakpoints.STATUS_PLANTED);
+ Object planted = map.get(IBreakpoints.STATUS_INSTANCES);
if (error != null) status = error;
else if (planted != null) status = "Planted";
if (status != null) text[0] += " (" + status + ")";
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModelPresentation.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModelPresentation.java
index b513350e3..f2023ffc2 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModelPresentation.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModelPresentation.java
@@ -15,14 +15,17 @@ import java.util.HashSet;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.model.ILineBreakpoint;
import org.eclipse.debug.core.model.IValue;
import org.eclipse.debug.ui.IDebugModelPresentation;
import org.eclipse.debug.ui.IValueDetailListener;
+import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.tm.internal.tcf.debug.model.TCFBreakpoint;
import org.eclipse.tm.internal.tcf.debug.ui.Activator;
+import org.eclipse.tm.internal.tcf.debug.ui.ImageCache;
import org.eclipse.ui.IEditorDescriptor;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorRegistry;
@@ -55,6 +58,20 @@ public class TCFModelPresentation implements IDebugModelPresentation {
}
public Image getImage(Object element) {
+ ImageDescriptor descriptor = null;
+ if (element instanceof TCFBreakpoint) {
+ TCFBreakpoint breakpoint = (TCFBreakpoint)element;
+ descriptor = ImageCache.getImageDescriptor(ImageCache.IMG_BREAKPOINT_DISABLED);
+ try {
+ if (breakpoint.isEnabled()) {
+ descriptor = ImageCache.getImageDescriptor(ImageCache.IMG_BREAKPOINT_ENABLED);
+ }
+ }
+ catch (CoreException e) {
+ }
+ //descriptor = new OverlayImageDescriptor( fDebugImageRegistry.get( descriptor ), computeBreakpointOverlays( breakpoint ) ) );
+ }
+ if (descriptor != null) return ImageCache.getImage(descriptor);
return null;
}
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExecContext.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExecContext.java
index 119665057..d7c3a2e93 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExecContext.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExecContext.java
@@ -494,15 +494,15 @@ public class TCFNodeExecContext extends TCFNode {
if (ctx != null && ctx.hasState()) {
// Thread
ContextState s = state.getData();
- if (s != null && s.terminated) return "icons/full/obj16/threadt_obj.gif";
- if (s != null && s.suspended) return "icons/full/obj16/threads_obj.gif";
- return "icons/full/obj16/thread_obj.gif";
+ if (s != null && s.terminated) return ImageCache.IMG_THREAD_TERMINATED;
+ if (s != null && s.suspended) return ImageCache.IMG_THREAD_SUSPENDED;
+ return ImageCache.IMG_THREAD_RUNNNIG;
}
else if (ctx != null) {
// Thread container (process)
- //if (terminated) return "icons/full/obj16/debugtt_obj.gif";
- if (hasSuspendedChildren()) return "icons/full/obj16/debugts_obj.gif";
- return "icons/full/obj16/debugt_obj.gif";
+ //if (terminated) return ImageCache.IMG_PROCESS_TERMINATED;
+ if (hasSuspendedChildren()) return ImageCache.IMG_PROCESS_SUSPENDED;
+ return ImageCache.IMG_PROCESS_RUNNING;
}
return super.getImageName();
}
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeRegister.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeRegister.java
index 6fc559085..37a0d56af 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeRegister.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeRegister.java
@@ -229,6 +229,6 @@ public class TCFNodeRegister extends TCFNode {
@Override
protected String getImageName() {
- return "icons/full/obj16/genericregister_obj.gif";
+ return ImageCache.IMG_REGISTER;
}
}
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeStackFrame.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeStackFrame.java
index c4b9fa308..91ba67499 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeStackFrame.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeStackFrame.java
@@ -309,8 +309,8 @@ public class TCFNodeStackFrame extends TCFNode {
@Override
protected String getImageName() {
- if (isRunning()) return "icons/full/obj16/stckframe_running_obj.gif";
- return "icons/full/obj16/stckframe_obj.gif";
+ if (isRunning()) return ImageCache.IMG_STACK_FRAME_RUNNING;
+ return ImageCache.IMG_STACK_FRAME_SUSPENDED;
}
@Override
diff --git a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFBreakpoint.java b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFBreakpoint.java
index c86c9c635..387fb170a 100644
--- a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFBreakpoint.java
+++ b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFBreakpoint.java
@@ -86,7 +86,7 @@ public class TCFBreakpoint extends Breakpoint {
if (marker == null) return null;
StringBuffer bf = new StringBuffer();
String address = marker.getAttribute(
- ITCFConstants.ID_TCF_DEBUG_MODEL + '.' + IBreakpoints.PROP_ADDRESS, null);
+ ITCFConstants.ID_TCF_DEBUG_MODEL + '.' + IBreakpoints.PROP_LOCATION, null);
if (address != null && address.length() > 0) {
bf.append("PC = ");
BigInteger n = new BigInteger(address, 10);
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 a38779f98..904358a3a 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
@@ -65,7 +65,7 @@ public class TCFBreakpointsModel implements IBreakpointListener, IBreakpointMana
return true;
}
- private String getBreakpointID(IBreakpoint bp) throws CoreException {
+ public String getBreakpointID(IBreakpoint bp) throws CoreException {
IMarker marker = bp.getMarker();
String id = (String)marker.getAttributes().get(ITCFConstants.ID_TCF_DEBUG_MODEL + '.' + IBreakpoints.PROP_ID);
if (id != null) return id;
@@ -331,7 +331,7 @@ public class TCFBreakpointsModel implements IBreakpointListener, IBreakpointMana
m.put(IBreakpoint.PERSISTED, Boolean.TRUE);
m.put(IBreakpoint.ID, ITCFConstants.ID_TCF_DEBUG_MODEL);
String msg = "";
- if (p.get(IBreakpoints.PROP_ADDRESS) != null) msg += p.get(IBreakpoints.PROP_ADDRESS);
+ if (p.get(IBreakpoints.PROP_LOCATION) != null) msg += p.get(IBreakpoints.PROP_LOCATION);
m.put(IMarker.MESSAGE, "Breakpoint: " + msg);
Number line = (Number)p.get(IBreakpoints.PROP_LINE);
if (line != null) {
@@ -378,7 +378,7 @@ public class TCFBreakpointsModel implements IBreakpointListener, IBreakpointMana
String condition = (String)p.get("org.eclipse.cdt.debug.core.condition");
if (condition != null && condition.length() > 0) m.put(IBreakpoints.PROP_CONDITION, condition);
Integer skip_count = (Integer)p.get("org.eclipse.cdt.debug.core.ignoreCount");
- if (skip_count != null && skip_count.intValue() > 0) m.put(IBreakpoints.PROP_SKIP_COUNT, skip_count);
+ if (skip_count != null && skip_count.intValue() > 0) m.put(IBreakpoints.PROP_IGNORECOUNT, skip_count);
return m;
}
}
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 0785e2050..35797a85a 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
@@ -16,7 +16,7 @@ import java.util.Iterator;
import java.util.Map;
import java.util.Set;
-import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.model.IBreakpoint;
import org.eclipse.tm.tcf.protocol.Protocol;
import org.eclipse.tm.tcf.services.IBreakpoints;
@@ -83,11 +83,14 @@ public class TCFBreakpointsStatus {
}
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;
- return getStatus(marker.getAttribute(
- ITCFConstants.ID_TCF_DEBUG_MODEL + '.' + IBreakpoints.PROP_ID, null));
+ try {
+ String id = TCFBreakpointsModel.getBreakpointsModel().getBreakpointID(bp);
+ if (id == null) return status_not_supported;
+ return getStatus(id);
+ }
+ catch (CoreException e) {
+ return status_not_supported;
+ }
}
public void addListener(ITCFBreakpointListener listener) {
diff --git a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFLaunch.java b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFLaunch.java
index 7bee2287c..3fd7701c3 100644
--- a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFLaunch.java
+++ b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/model/TCFLaunch.java
@@ -79,10 +79,10 @@ public class TCFLaunch extends Launch {
}
};
if (mode.equals(ILaunchManager.DEBUG_MODE)) {
+ breakpoints_status = new TCFBreakpointsStatus(this);
Activator.getBreakpointsModel().downloadBreakpoints(channel, new Runnable() {
public void run() {
if (channel.getState() != IChannel.STATE_OPEN) return;
- breakpoints_status = new TCFBreakpointsStatus(TCFLaunch.this);
runLaunchSequence(done);
}
});
diff --git a/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/services/TCFDSFBreakpoints.java b/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/services/TCFDSFBreakpoints.java
index 0d3c7cd00..f310d160b 100644
--- a/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/services/TCFDSFBreakpoints.java
+++ b/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/services/TCFDSFBreakpoints.java
@@ -177,14 +177,17 @@ public class TCFDSFBreakpoints extends AbstractDsfService implements org.eclipse
@SuppressWarnings("unchecked")
public IAddress[] getAddresses() {
if (status == null) return null;
- Map<String,Collection<Number>> arr = (Map<String,Collection<Number>>)status.get(IBreakpoints.STATUS_PLANTED);
+ Collection<Map<String,Object>> arr = (Collection<Map<String,Object>>)status.get(IBreakpoints.STATUS_INSTANCES);
if (arr == null) return null;
int cnt = 0;
- for (Collection<Number> c : arr.values()) cnt += c.size();
+ for (Map<String,Object> m : arr) {
+ if (m.get(IBreakpoints.INSTANCE_ADDRESS) != null) cnt++;
+ }
IAddress[] res = new IAddress[cnt];
int pos = 0;
- for (Collection<Number> c : arr.values()) {
- for (Number addr : c) res[pos++] = new TCFAddress(addr);
+ for (Map<String,Object> m : arr) {
+ Number n = (Number)m.get(IBreakpoints.INSTANCE_ADDRESS);
+ if (n != null) res[pos++] = new TCFAddress(n);
}
return res;
}
@@ -213,7 +216,7 @@ public class TCFDSFBreakpoints extends AbstractDsfService implements org.eclipse
}
public int getIgnoreCount() {
- Integer count = (Integer)attrs.get(ITCFConstants.ID_TCF_DEBUG_MODEL + '.' + IBreakpoints.PROP_SKIP_COUNT);
+ Integer count = (Integer)attrs.get(ITCFConstants.ID_TCF_DEBUG_MODEL + '.' + IBreakpoints.PROP_IGNORECOUNT);
if (count != null) return count.intValue();
return 0;
}
@@ -242,9 +245,12 @@ public class TCFDSFBreakpoints extends AbstractDsfService implements org.eclipse
Set<IBreakpointsTargetDMContext> add_targets = new HashSet<IBreakpointsTargetDMContext>();
Set<IBreakpointsTargetDMContext> rem_targets = new HashSet<IBreakpointsTargetDMContext>();
if (map != null) {
- Map<String,Collection<Number>> arr = (Map<String,Collection<Number>>)map.get(IBreakpoints.STATUS_PLANTED);
+ Collection<Map<String,Object>> arr = (Collection<Map<String,Object>>)map.get(IBreakpoints.STATUS_INSTANCES);
if (arr != null) {
- for (String ctx_id : arr.keySet()) add_targets.add(rc.getContext(ctx_id));
+ for (Map<String,Object> m : arr) {
+ String ctx_id = (String)m.get(IBreakpoints.INSTANCE_CONTEXT);
+ if (ctx_id != null) add_targets.add(rc.getContext(ctx_id));
+ }
}
}
for (IBreakpointsTargetDMContext t : dmc.targets) {
diff --git a/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/services/IBreakpoints.java b/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/services/IBreakpoints.java
index 6d3b204b6..c82a36b01 100644
--- a/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/services/IBreakpoints.java
+++ b/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/services/IBreakpoints.java
@@ -40,32 +40,85 @@ public interface IBreakpoints extends IService {
* Breakpoint property names.
*/
static final String
- PROP_ID = "ID", // String
- PROP_ENABLED = "Enabled", // Boolean
- PROP_ADDRESS = "Address", // String
- PROP_CONDITION = "Condition", // String
- PROP_FILE = "File", // String
- PROP_LINE = "Line", // Number
- PROP_COLUMN = "Column", // Number
- PROP_SKIP_COUNT = "SkipCount"; // Number
+ PROP_ID = "ID", // String
+ PROP_ENABLED = "Enabled", // Boolean
+ PROP_TYPE = "BreakpointType", // String
+ PROP_CONTEXTNAMES = "ContextNames", // Array
+ PROP_CONTEXTIDS = "ContextIds", // Array
+ PROP_EXECUTABLEPATHS = "ExecPaths", // Array
+ PROP_LOCATION = "Location", // String
+ PROP_SIZE = "Size", // Number
+ PROP_ACCESSMODE = "AccessMode", // Number
+ PROP_FILE = "File", // String
+ PROP_LINE = "Line", // Number
+ PROP_COLUMN = "Column", // Number
+ PROP_PATTERN = "MaskValue", // Number
+ PROP_MASK = "Mask", // Number
+ PROP_STOP_GROUP = "StopGroup", // Array
+ PROP_IGNORECOUNT = "IgnoreCount", // Number
+ PROP_TIME = "Time", // Number
+ PROP_SCALE = "TimeScale", // String
+ PROP_UNITS = "TimeUnits", // String
+ PROP_CONDITION = "Condition", // String
+ PROP_TEMPORARY = "Temporary"; // Boolean
+
+ /**
+ * BreakpointType values
+ */
+ static final String
+ TYPE_RELATIVE = "Software",
+ TYPE_ABSOLUTE = "Hardware",
+ TYPE_AUTO = "Auto";
+
+ /**
+ * AccessMode values
+ */
+ static final int
+ ACCESSMODE_READ = 0x01,
+ ACCESSMODE_WRITE = 0x02,
+ ACCESSMODE_EXECUTE = 0x04,
+ ACCESSMODE_CHANGE = 0x08;
+
+ /**
+ * TimeScale values
+ */
+ static final String
+ TIMESCALE_RELATIVE = "Relative",
+ TIMESCALE_ABSOLUTE = "Absolute";
+
+ /**
+ * TimeUnits values
+ */
+ static final String
+ TIMEUNIT_NSECS = "Nanoseconds",
+ TIMEUNIT_CYCLE_COUNT = "CycleCount",
+ TIMEUNIT_INSTRUCTION_COUNT = "InstructionCount";
/**
* Breakpoint status field names.
*/
static final String
- STATUS_PLANTED = "Planted", // Map<String: Memory context ID,Collection<Number: address>>
+ STATUS_INSTANCES = "Instances", // Array of Map<String,Object>
STATUS_ERROR = "Error", // String
STATUS_FILE = "File", // String
STATUS_LINE = "Line", // Number
STATUS_COLUMN = "Column"; // Number
/**
+ * Breakpoint instance field names.
+ */
+ static final String
+ INSTANCE_ERROR = "Error", // String
+ INSTANCE_CONTEXT = "LocationContext", // String
+ INSTANCE_ADDRESS = "Address"; // Number
+
+ /**
* Breakpoint service capabilities.
*/
static final String
CAPABILITY_CONTEXT_ID = "ID", // String
CAPABILITY_HAS_CHILDREN = "HasChildren", // Boolean
- CAPABILITY_ADDRESS = "Address", // Boolean
+ CAPABILITY_ADDRESS = "Location", // Boolean
CAPABILITY_CONDITION = "Condition", // Boolean
CAPABILITY_FILE_LINE = "FileLine"; // Boolean

Back to the top