Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Grunberg2012-02-21 16:25:27 -0500
committerRoland Grunberg2012-02-21 16:25:27 -0500
commitfb349d615248bd796c3bd0c9070d1bfbdede67d3 (patch)
tree330c31ce436997056459285bad5ba4526d97e724 /valgrind
parent274ec148c1df6bd7384497c5d26978e3f61aba6f (diff)
downloadorg.eclipse.linuxtools-fb349d615248bd796c3bd0c9070d1bfbdede67d3.tar.gz
org.eclipse.linuxtools-fb349d615248bd796c3bd0c9070d1bfbdede67d3.tar.xz
org.eclipse.linuxtools-fb349d615248bd796c3bd0c9070d1bfbdede67d3.zip
Use getFullPath() instead of getLocation() when linking to source
code. The call to getSourceElement may return an Object that has a file system path associated with it, but does not implement the IFile interface. If it implements IStorage, we can still link to the source code.
Diffstat (limited to 'valgrind')
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifPlugin.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifPlugin.java b/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifPlugin.java
index 43ba0d7b7c..c82dc7f665 100644
--- a/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifPlugin.java
+++ b/valgrind/org.eclipse.linuxtools.valgrind.massif/src/org/eclipse/linuxtools/internal/valgrind/massif/MassifPlugin.java
@@ -10,7 +10,8 @@
*******************************************************************************/
package org.eclipse.linuxtools.internal.valgrind.massif;
-import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IStorage;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.model.ISourceLocator;
import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector;
@@ -74,12 +75,14 @@ public class MassifPlugin extends AbstractUIPlugin {
public void openEditorForNode(MassifHeapTreeNode element) {
// do source lookup
+ String workspaceLocation = ResourcesPlugin.getWorkspace().getRoot().getLocation().toOSString();
ISourceLocator sourceLocator = MassifPlugin.getDefault().getSourceLocator();
if (sourceLocator instanceof ISourceLookupDirector) {
Object obj = ((ISourceLookupDirector) sourceLocator).getSourceElement(element.getFilename());
- if (obj != null && obj instanceof IFile) {
+ if (obj != null && obj instanceof IStorage) {
try {
- ProfileUIUtils.openEditorAndSelect(((IFile) obj).getLocation().toOSString(), element.getLine());
+ String fullFilePath = workspaceLocation + ((IStorage) obj).getFullPath().toOSString();
+ ProfileUIUtils.openEditorAndSelect(fullFilePath, element.getLine());
} catch (PartInitException e) {
e.printStackTrace();
} catch (BadLocationException e) {

Back to the top