Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/dsf
diff options
context:
space:
mode:
authorMarc Khouzam2010-04-22 23:44:30 +0000
committerMarc Khouzam2010-04-22 23:44:30 +0000
commitcaa6d148db32410c163ca4204483bb618c6c81e8 (patch)
tree0070a2c5df0d653a87f76c364cecc70217eb191a /dsf
parentf29a16e895c5bc949445734b66238b3b90b12cc5 (diff)
downloadorg.eclipse.cdt-caa6d148db32410c163ca4204483bb618c6c81e8.tar.gz
org.eclipse.cdt-caa6d148db32410c163ca4204483bb618c6c81e8.tar.xz
org.eclipse.cdt-caa6d148db32410c163ca4204483bb618c6c81e8.zip
[248627] Support "Show Full Path" action for DSF
Diffstat (limited to 'dsf')
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/IDsfDebugUIConstants.java12
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/AbstractLaunchVMProvider.java21
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/StackFramesVMNode.java25
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfLaunch.java12
4 files changed, 64 insertions, 6 deletions
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/IDsfDebugUIConstants.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/IDsfDebugUIConstants.java
index de4ddfa2f56..ff61e309b78 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/IDsfDebugUIConstants.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/IDsfDebugUIConstants.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 Wind River Systems and others.
+ * Copyright (c) 2006, 2010 Wind River Systems 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
@@ -10,7 +10,9 @@
*******************************************************************************/
package org.eclipse.cdt.dsf.debug.ui;
+import org.eclipse.cdt.debug.internal.ui.preferences.ICDebugPreferenceConstants;
import org.eclipse.cdt.dsf.internal.ui.DsfUIPlugin;
+import org.eclipse.debug.ui.IDebugUIConstants;
/**
* @noimplement This interface is not intended to be implemented by clients.
@@ -86,4 +88,12 @@ public interface IDsfDebugUIConstants {
* @since 2.1
*/
public static final String ID_EXPRESSION_HOVER= PLUGIN_ID + ".expression_hover"; //$NON-NLS-1$
+
+ /**
+ * Property id to know if we should show full paths in the debug view.
+ * The value of this id must match what is being used as a full key in ShowFullPathsAction.run()
+ *
+ * @since 2.1 */
+ public static final String DEBUG_VIEW_SHOW_FULL_PATH_PROPERTY = IDebugUIConstants.ID_DEBUG_VIEW + "." + ICDebugPreferenceConstants.PREF_SHOW_FULL_PATHS; //$NON-NLS-1$
+
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/AbstractLaunchVMProvider.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/AbstractLaunchVMProvider.java
index 6f26a4ebe1c..7f7d3b1299e 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/AbstractLaunchVMProvider.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/AbstractLaunchVMProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 Wind River Systems and others.
+ * Copyright (c) 2006, 2010 Wind River Systems 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
@@ -17,6 +17,7 @@ import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
+import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
import org.eclipse.cdt.dsf.concurrent.DsfRunnable;
import org.eclipse.cdt.dsf.concurrent.RequestMonitor;
import org.eclipse.cdt.dsf.concurrent.ThreadSafe;
@@ -85,7 +86,11 @@ public class AbstractLaunchVMProvider extends AbstractDMVMProvider
handlePropertyChanged(store, event);
}};
store.addPropertyChangeListener(fPreferencesListener);
-
+
+ final IPreferenceStore cStore= CDebugUIPlugin.getDefault().getPreferenceStore();
+ getPresentationContext().setProperty(IDsfDebugUIConstants.DEBUG_VIEW_SHOW_FULL_PATH_PROPERTY, cStore.getBoolean(IDsfDebugUIConstants.DEBUG_VIEW_SHOW_FULL_PATH_PROPERTY));
+ cStore.addPropertyChangeListener(fPreferencesListener);
+
// Register the LaunchVM provider as a listener to debug and launch
// events. These events are used by the launch and processes nodes.
DebugPlugin.getDefault().addDebugEventListener(this);
@@ -209,6 +214,9 @@ public class AbstractLaunchVMProvider extends AbstractDMVMProvider
final IPreferenceStore store= DsfUIPlugin.getDefault().getPreferenceStore();
store.removePropertyChangeListener(fPreferencesListener);
+ final IPreferenceStore cStore= CDebugUIPlugin.getDefault().getPreferenceStore();
+ cStore.removePropertyChangeListener(fPreferencesListener);
+
super.dispose();
}
@@ -275,6 +283,8 @@ public class AbstractLaunchVMProvider extends AbstractDMVMProvider
protected void handlePropertyChanged(final IPreferenceStore store, final PropertyChangeEvent event) {
String property = event.getProperty();
+ boolean processEvent = false;
+
if (IDsfDebugUIConstants.PREF_STACK_FRAME_LIMIT_ENABLE.equals(property)
|| IDsfDebugUIConstants.PREF_STACK_FRAME_LIMIT.equals(property)) {
if (store.getBoolean(IDsfDebugUIConstants.PREF_STACK_FRAME_LIMIT_ENABLE)) {
@@ -282,6 +292,13 @@ public class AbstractLaunchVMProvider extends AbstractDMVMProvider
} else {
getPresentationContext().setProperty(IDsfDebugUIConstants.PREF_STACK_FRAME_LIMIT, null);
}
+ processEvent = true;
+ } else if (IDsfDebugUIConstants.DEBUG_VIEW_SHOW_FULL_PATH_PROPERTY.equals(property)) {
+ getPresentationContext().setProperty(IDsfDebugUIConstants.DEBUG_VIEW_SHOW_FULL_PATH_PROPERTY, event.getNewValue());
+ processEvent = true;
+ }
+
+ if (processEvent) {
getExecutor().execute(new DsfRunnable() {
public void run() {
handleEvent(event);
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/StackFramesVMNode.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/StackFramesVMNode.java
index 4cfdf71347e..2008c3ec028 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/StackFramesVMNode.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/ui/viewmodel/launch/StackFramesVMNode.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 Wind River Systems and others.
+ * Copyright (c) 2006, 2010 Wind River Systems 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
@@ -26,12 +26,12 @@ import org.eclipse.cdt.dsf.datamodel.DMContexts;
import org.eclipse.cdt.dsf.datamodel.DataModelInitializedEvent;
import org.eclipse.cdt.dsf.datamodel.IDMContext;
import org.eclipse.cdt.dsf.debug.service.IRunControl;
-import org.eclipse.cdt.dsf.debug.service.IStack;
import org.eclipse.cdt.dsf.debug.service.IRunControl.IContainerDMContext;
import org.eclipse.cdt.dsf.debug.service.IRunControl.IContainerSuspendedDMEvent;
import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMContext;
import org.eclipse.cdt.dsf.debug.service.IRunControl.IExitedDMEvent;
import org.eclipse.cdt.dsf.debug.service.IRunControl.ISuspendedDMEvent;
+import org.eclipse.cdt.dsf.debug.service.IStack;
import org.eclipse.cdt.dsf.debug.service.IStack.IFrameDMContext;
import org.eclipse.cdt.dsf.debug.service.IStack.IFrameDMData;
import org.eclipse.cdt.dsf.debug.ui.IDsfDebugUIConstants;
@@ -55,7 +55,9 @@ import org.eclipse.cdt.dsf.ui.viewmodel.properties.LabelColumnInfo;
import org.eclipse.cdt.dsf.ui.viewmodel.properties.LabelImage;
import org.eclipse.cdt.dsf.ui.viewmodel.properties.LabelText;
import org.eclipse.cdt.dsf.ui.viewmodel.properties.PropertiesBasedLabelProvider;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenCountUpdate;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementCompareRequest;
@@ -432,7 +434,15 @@ public class StackFramesVMNode extends AbstractDMVMNode
if (address != null) {
update.setProperty(ILaunchVMConstants.PROP_FRAME_ADDRESS, "0x" + address.toString(16)); //$NON-NLS-1$
}
- update.setProperty(ILaunchVMConstants.PROP_FRAME_FILE, data.getFile());
+
+ IPath filePath = new Path(data.getFile());
+ String fileName = filePath.toOSString();
+ Object showFullPathPreference = getVMProvider().getPresentationContext().getProperty(IDsfDebugUIConstants.DEBUG_VIEW_SHOW_FULL_PATH_PROPERTY);
+ if (showFullPathPreference instanceof Boolean && (Boolean)showFullPathPreference == false) {
+ fileName = filePath.lastSegment();
+ }
+ update.setProperty(ILaunchVMConstants.PROP_FRAME_FILE, fileName);
+
update.setProperty(ILaunchVMConstants.PROP_FRAME_FUNCTION, data.getFunction());
update.setProperty(ILaunchVMConstants.PROP_FRAME_LINE, data.getLine());
update.setProperty(ILaunchVMConstants.PROP_FRAME_COLUMN, data.getColumn());
@@ -562,6 +572,8 @@ public class StackFramesVMNode extends AbstractDMVMNode
|| IDsfDebugUIConstants.PREF_STACK_FRAME_LIMIT.equals(property))
{
return IModelDelta.CONTENT;
+ } else if (IDsfDebugUIConstants.DEBUG_VIEW_SHOW_FULL_PATH_PROPERTY.equals(property)) {
+ return IModelDelta.STATE;
}
} else {
}
@@ -610,6 +622,8 @@ public class StackFramesVMNode extends AbstractDMVMNode
|| IDsfDebugUIConstants.PREF_STACK_FRAME_LIMIT.equals(property))
{
buildDeltaForStackFrameLimitPreferenceChangedEvent(parent, rm);
+ } else if (IDsfDebugUIConstants.DEBUG_VIEW_SHOW_FULL_PATH_PROPERTY.equals(property)) {
+ buildDeltaForShowFullPathPreferenceChangedEvent(parent, rm);
} else {
rm.done();
}
@@ -724,6 +738,11 @@ public class StackFramesVMNode extends AbstractDMVMNode
rm.done();
}
+ private void buildDeltaForShowFullPathPreferenceChangedEvent(final VMDelta parentDelta, final RequestMonitor rm) {
+ parentDelta.setFlags(parentDelta.getFlags() | IModelDelta.STATE);
+ rm.done();
+ }
+
private String produceFrameElementName( String viewName , IFrameDMContext frame ) {
/*
* We are addressing Bugzilla 211490 which wants the Register View to keep the same expanded
diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfLaunch.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfLaunch.java
index a71a76cc99e..e708918a6bb 100644
--- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfLaunch.java
+++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/model/DsfLaunch.java
@@ -28,6 +28,13 @@ import org.eclipse.debug.core.model.ISourceLocator;
*/
public class DsfLaunch extends Launch {
+ /*
+ * Used to indicate that this launch supports the "Show Full Path" action in the debug view.
+ * This constant must have the same value as ICDebugPreferenceConstants.PREF_SHOW_FULL_PATHS
+ * We have our own copy to avoid a dependency.
+ */
+ private static final String PREF_SHOW_FULL_PATHS = "org.eclipse.cdt.debug.ui.cDebug.show_full_paths"; //$NON-NLS-1$
+
private class EventSchedulingRule implements ISchedulingRule {
DsfLaunch fLaunch = DsfLaunch.this;
@@ -51,6 +58,11 @@ public class DsfLaunch extends Launch {
public DsfLaunch(ILaunchConfiguration launchConfiguration, String mode, ISourceLocator locator) {
super(launchConfiguration, mode, locator);
+
+ // Just set this attribute to any value. It's presence indicates that the
+ // "Show Full Path" action is supported in the debug view.
+ // see org.eclipse.cdt.debug.internal.ui.actions.ShowFullPathsAction
+ setAttribute(PREF_SHOW_FULL_PATHS, ""); //$NON-NLS-1$
}
@Override

Back to the top