Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2014-07-09 18:09:34 +0000
committerEugene Tarassov2014-07-09 18:09:34 +0000
commit3d28b300476cda7c647fc778079f4de69fea61e5 (patch)
treed295e82c0596b53a15d5e99dc86d0e06afb96439 /plugins
parente29b92ea344912e1c26865e950a2e90e133dd6cb (diff)
downloadorg.eclipse.tcf-3d28b300476cda7c647fc778079f4de69fea61e5.tar.gz
org.eclipse.tcf-3d28b300476cda7c647fc778079f4de69fea61e5.tar.xz
org.eclipse.tcf-3d28b300476cda7c647fc778079f4de69fea61e5.zip
TCF Debugger: fixed NPE in memory map widget when memory region has no file name attribute
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/MemoryMapWidget.java20
1 files changed, 10 insertions, 10 deletions
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 66524018b..12cc51304 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
@@ -183,12 +183,14 @@ public class MemoryMapWidget {
IMemoryMap.MemoryRegion region1 = all.get(i);
boolean multiple = false;
ArrayList<IMemoryMap.MemoryRegion> children = new ArrayList<IMemoryMap.MemoryRegion>();
- for (int j = i + 1; j < all.size(); j++) {
- IMemoryMap.MemoryRegion region2 = all.get(j);
- if (!region1.equals(region2) && region1.getFileName().equals(region2.getFileName())) {
- multiple = true;
- children.add(region2);
- removed.add(region2);
+ if (region1.getFileName() != null) {
+ for (int j = i + 1; j < all.size(); j++) {
+ IMemoryMap.MemoryRegion region2 = all.get(j);
+ if (!region1.equals(region2) && region1.getFileName().equals(region2.getFileName())) {
+ multiple = true;
+ children.add(region2);
+ removed.add(region2);
+ }
}
}
if (!removed.contains(region1)) {
@@ -198,8 +200,7 @@ public class MemoryMapWidget {
Map<String, Object> props = new HashMap<String, Object>();
props.put(IMemoryMap.PROP_FILE_NAME, region1.getFileName());
props.put("_CHILDREN", children.toArray()); //$NON-NLS-1$
- TCFMemoryRegion region = new TCFMemoryRegion(props);
- roots.add(region);
+ roots.add(new TCFMemoryRegion(props));
}
else {
roots.add(region1);
@@ -932,8 +933,7 @@ public class MemoryMapWidget {
String[] arr = ids.toArray(new String[ids.size()]);
Arrays.sort(arr);
ctx_text.removeAll();
- for (String id : arr)
- ctx_text.add(id);
+ for (String id : arr) ctx_text.add(id);
if (map_id == null && arr.length > 0) map_id = arr[0];
if (map_id == null) map_id = ""; //$NON-NLS-1$
ctx_text.setText(map_id);

Back to the top