diff --git a/core/org.eclipse.cdt.core/ChangeLog b/core/org.eclipse.cdt.core/ChangeLog index a736337b57f..c007f85c3ff 100644 --- a/core/org.eclipse.cdt.core/ChangeLog +++ b/core/org.eclipse.cdt.core/ChangeLog @@ -1,3 +1,9 @@ +2004-09-14 Alain Magloire + Try to find the function in the header. + * model/org/eclipse/cdt/internal/core/model/BinaryElement.java + * model/org/eclipse/cdt/internal/core/model/BinaryFunction.java + * model/org/eclipse/cdt/internal/core/model/BinaryModule.java + 2004-09-14 Alain Magloire Define for the contentType extensions for diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryElement.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryElement.java index 4101adc58d1..15ef7a0b0a2 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryElement.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryElement.java @@ -113,6 +113,9 @@ public class BinaryElement extends CElement implements IBinaryElement, ISourceMa tu = (ITranslationUnit)e; } } + // do not give up yet in C++ the methods may be inline in the headers + ICProject cproject = getCProject(); + tu = mgr.createTranslationUnitFrom(cproject, path); } else { // TODO-model: handle non-absolute paths when finding source files // ??? assert() diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryFunction.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryFunction.java index aed58f10c93..da8d61c4df9 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryFunction.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryFunction.java @@ -11,12 +11,12 @@ package org.eclipse.cdt.internal.core.model; +import org.eclipse.cdt.core.model.IBinaryFunction; import org.eclipse.cdt.core.model.ICElement; -import org.eclipse.cdt.core.model.IFunction; /** */ -public class BinaryFunction extends BinaryElement implements IFunction { +public class BinaryFunction extends BinaryElement implements IBinaryFunction { public BinaryFunction(ICElement parent, String name, long a) { super(parent, name, ICElement.C_FUNCTION, a); diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryModule.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryModule.java index 29081aefcf8..d3fea333ec3 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryModule.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/BinaryModule.java @@ -19,6 +19,7 @@ import org.eclipse.cdt.core.model.IBinaryElement; import org.eclipse.cdt.core.model.IBinaryModule; import org.eclipse.cdt.core.model.ICElement; import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.IWorkspaceRoot; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; @@ -26,11 +27,11 @@ import org.eclipse.core.runtime.IProgressMonitor; */ public class BinaryModule extends Parent implements IBinaryModule { - IPath path; + IPath fPath; public BinaryModule(Binary parent, IPath p) { super(parent, p.lastSegment(), ICElement.C_VCONTAINER); - path = p; + fPath = p; } /* (non-Javadoc) @@ -61,6 +62,11 @@ public class BinaryModule extends Parent implements IBinaryModule { * @see org.eclipse.cdt.core.model.ICElement#getResource() */ public IResource getResource() { + IWorkspaceRoot root = getCModel().getWorkspace().getRoot(); + IPath path = getPath(); + if (path != null) { + return root.getFileForLocation(fPath); + } return null; } @@ -82,7 +88,7 @@ public class BinaryModule extends Parent implements IBinaryModule { * @see org.eclipse.cdt.core.model.ICElement#getPath() */ public IPath getPath() { - return path; + return fPath; } /* (non-Javadoc)