From 2690b106c543b97b7590421b44f847b8ebfa8554 Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Mon, 9 Sep 2013 14:09:09 -0700 Subject: [PATCH] Added local-to-file information to toString() method. --- .../cdt/internal/core/pdom/dom/PDOMBinding.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMBinding.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMBinding.java index 0059f608028..22b81c33e48 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMBinding.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMBinding.java @@ -12,6 +12,9 @@ *******************************************************************************/ package org.eclipse.cdt.internal.core.pdom.dom; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; + import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.dom.ast.ASTTypeUtil; import org.eclipse.cdt.core.dom.ast.DOMException; @@ -37,9 +40,6 @@ import org.eclipse.cdt.internal.core.pdom.db.IString; import org.eclipse.cdt.internal.core.pdom.tag.PDOMTaggable; import org.eclipse.core.runtime.CoreException; -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; - /** * Base class for bindings in the PDOM. */ @@ -261,7 +261,13 @@ public abstract class PDOMBinding extends PDOMNamedNode implements IPDOMBinding @Override public final String toString() { String name = toStringBase(); - return name + " " + getConstantNameForValue(getLinkage(), getNodeType()); //$NON-NLS-1$ + try { + PDOMFile localToFile = getLocalToFile(); + if (localToFile != null) + return name + " (local to " + localToFile.getLocation().getURI().getPath() + ")"; //$NON-NLS-1$ //$NON-NLS-2$ + } catch (CoreException e) { + } + return name; } protected String toStringBase() {