Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2020-03-27 16:03:08 +0000
committerEugene Tarassov2020-03-27 16:03:08 +0000
commit724eaa06cde5fa610deb3cd2f7efbd885d4570a6 (patch)
treee43f191fa495eed8d80888a44b80bf52081685ec /plugins
parentc31c130888eaec8edbdaf757b545e2f0639f1911 (diff)
downloadorg.eclipse.tcf-724eaa06cde5fa610deb3cd2f7efbd885d4570a6.tar.gz
org.eclipse.tcf-724eaa06cde5fa610deb3cd2f7efbd885d4570a6.tar.xz
org.eclipse.tcf-724eaa06cde5fa610deb3cd2f7efbd885d4570a6.zip
TCF Debugger: added UUID to memory region properties
UUID is generated when user adds entry in the Symbol Files dialog. It allows GUI to identify user entry even when it looks identical to an entry from another client or from the target.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/MemoryMapItemDialog.java8
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/MemoryMapWidget.java11
2 files changed, 8 insertions, 11 deletions
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/MemoryMapItemDialog.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/MemoryMapItemDialog.java
index b3fbde751..fa9004440 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/MemoryMapItemDialog.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/MemoryMapItemDialog.java
@@ -21,7 +21,6 @@ import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
@@ -33,6 +32,7 @@ import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.tcf.internal.debug.ui.ImageCache;
import org.eclipse.tcf.internal.debug.ui.model.TCFModel;
import org.eclipse.tcf.protocol.JSON;
import org.eclipse.tcf.services.IMemoryMap;
@@ -41,7 +41,6 @@ class MemoryMapItemDialog extends Dialog {
private final Map<String,Object> props;
private final boolean enable_editing;
- private final Image image;
private Text addr_text;
private Text size_text;
@@ -52,9 +51,8 @@ class MemoryMapItemDialog extends Dialog {
private Button wr_button;
private Button ex_button;
- MemoryMapItemDialog(Shell parent, Image image, Map<String,Object> props, boolean enable_editing) {
+ MemoryMapItemDialog(Shell parent, Map<String,Object> props, boolean enable_editing) {
super(parent);
- this.image = image;
this.props = props;
this.enable_editing = enable_editing;
}
@@ -63,7 +61,7 @@ class MemoryMapItemDialog extends Dialog {
protected void configureShell(Shell shell) {
super.configureShell(shell);
shell.setText("Symbol File");
- shell.setImage(image);
+ shell.setImage(ImageCache.getImage(ImageCache.IMG_MEMORY_MAP));
}
@Override
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/MemoryMapWidget.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/MemoryMapWidget.java
index 36eaa65c8..2db816a94 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/MemoryMapWidget.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/MemoryMapWidget.java
@@ -19,6 +19,7 @@ import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import java.util.UUID;
import org.eclipse.core.resources.IStorage;
import org.eclipse.core.resources.ResourcesPlugin;
@@ -73,7 +74,6 @@ import org.eclipse.tcf.internal.debug.model.TCFLaunch;
import org.eclipse.tcf.internal.debug.model.TCFMemoryRegion;
import org.eclipse.tcf.internal.debug.model.TCFSymFileRef;
import org.eclipse.tcf.internal.debug.ui.Activator;
-import org.eclipse.tcf.internal.debug.ui.ImageCache;
import org.eclipse.tcf.internal.debug.ui.model.TCFChildren;
import org.eclipse.tcf.internal.debug.ui.model.TCFModel;
import org.eclipse.tcf.internal.debug.ui.model.TCFNode;
@@ -557,9 +557,9 @@ public class MemoryMapWidget {
String id = ctx_text.getText();
if (id == null || id.length() == 0) return;
Map<String, Object> props = new HashMap<String, Object>();
- Image image = ImageCache.getImage(ImageCache.IMG_MEMORY_MAP);
- if (new MemoryMapItemDialog(map_table.getShell(), image, props, true).open() == Window.OK) {
- props.put(IMemoryMap.PROP_ID, id);
+ if (new MemoryMapItemDialog(map_table.getShell(), props, true).open() == Window.OK) {
+ props.put(IMemoryMap.PROP_ID, id); // Context ID
+ props.put("UUID", UUID.randomUUID().toString()); // Unique ID of this region
ArrayList<IMemoryMap.MemoryRegion> lst = cur_maps.get(id);
if (lst == null) cur_maps.put(id, lst = new ArrayList<IMemoryMap.MemoryRegion>());
lst.add(new TCFMemoryRegion(props));
@@ -640,8 +640,7 @@ public class MemoryMapWidget {
Map<String, Object> props = region.getProperties();
final boolean enable_editing = !(region instanceof ForeignRegion);
if (enable_editing) props = new HashMap<String, Object>(props);
- Image image = ImageCache.getImage(ImageCache.IMG_MEMORY_MAP);
- MemoryMapItemDialog dlg = new MemoryMapItemDialog(map_table.getShell(), image, props, enable_editing) {
+ MemoryMapItemDialog dlg = new MemoryMapItemDialog(map_table.getShell(), props, enable_editing) {
protected void createStatusFields(Composite parent) {
try {
if (mem_node != null && region != null) {

Back to the top