Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Leherbauer2013-11-04 07:34:05 -0500
committerAnton Leherbauer2013-11-04 07:34:05 -0500
commit540419dc1116a44c06d03862b30f4f98b7520677 (patch)
tree66138cb897819bfa7d9394663f1899843d2c82d9
parentf334367d505612fb98e03712501b5deacef47407 (diff)
downloadorg.eclipse.tcf-540419dc1116a44c06d03862b30f4f98b7520677.tar.gz
org.eclipse.tcf-540419dc1116a44c06d03862b30f4f98b7520677.tar.xz
org.eclipse.tcf-540419dc1116a44c06d03862b30f4f98b7520677.zip
TCF Debugger: Bug 420641 - Cannot edit Symbol Files if Launch is
selected
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/MemoryMapWidget.java3
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/TCFMemoryMapTab.java24
2 files changed, 17 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 93abdc5d9..1ebf87502 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
@@ -544,7 +544,8 @@ public class MemoryMapWidget {
}
catch (Exception x) {
if (channel.getState() != IChannel.STATE_OPEN) return null;
- Activator.log("Cannot get selected memory node", x);
+ // Don't log error. This is expected if the selected node has no containing memory context
+ // Activator.log("Cannot get selected memory node", x);
return null;
}
}
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/TCFMemoryMapTab.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/TCFMemoryMapTab.java
index eb5a75a70..279b7808c 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/TCFMemoryMapTab.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/TCFMemoryMapTab.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Wind River Systems, Inc. and others.
+ * Copyright (c) 2011, 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
@@ -13,6 +13,7 @@ package org.eclipse.tcf.internal.debug.ui.launch;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.core.Launch;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.swt.SWT;
@@ -22,8 +23,10 @@ import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.tcf.internal.debug.model.TCFLaunch;
import org.eclipse.tcf.internal.debug.ui.ImageCache;
import org.eclipse.tcf.internal.debug.ui.commands.MemoryMapWidget;
+import org.eclipse.tcf.internal.debug.ui.model.TCFModelManager;
import org.eclipse.tcf.internal.debug.ui.model.TCFNode;
public class TCFMemoryMapTab extends AbstractLaunchConfigurationTab {
@@ -33,9 +36,7 @@ public class TCFMemoryMapTab extends AbstractLaunchConfigurationTab {
private MemoryMapWidget widget;
public void createControl(Composite parent) {
- TCFNode node = null;
- IAdaptable adaptable = DebugUITools.getDebugContext();
- if (adaptable != null) node = (TCFNode)adaptable.getAdapter(TCFNode.class);
+ TCFNode node = getSelectedNode();
Composite composite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout(1, false);
composite.setFont(parent.getFont());
@@ -77,11 +78,7 @@ public class TCFMemoryMapTab extends AbstractLaunchConfigurationTab {
*/
public boolean updateContext() {
if (widget != null) {
- TCFNode node = null;
- IAdaptable adaptable = DebugUITools.getDebugContext();
- if (adaptable != null) {
- node = (TCFNode)adaptable.getAdapter(TCFNode.class);
- }
+ TCFNode node = getSelectedNode();
if (node != null) {
return widget.setTCFNode(node);
}
@@ -120,4 +117,13 @@ public class TCFMemoryMapTab extends AbstractLaunchConfigurationTab {
public String getId() {
return TAB_ID;
}
+
+ private TCFNode getSelectedNode() {
+ TCFNode node = null;
+ IAdaptable adaptable = DebugUITools.getDebugContext();
+ if (adaptable instanceof TCFLaunch) node = TCFModelManager.getRootNodeSync((Launch)adaptable);
+ else if (adaptable != null) node = (TCFNode)adaptable.getAdapter(TCFNode.class);
+ return node;
+ }
+
}

Back to the top