Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorSergey Prigogin2012-04-28 01:33:31 +0000
committerSergey Prigogin2012-04-28 02:20:09 +0000
commite1b227f33885c877f1f6c161bc400a521399382a (patch)
tree86f1282a539df8bd711d982607506ad591b5c284 /core
parentcf5d5508884c882fffa593f61f482198480d82b8 (diff)
downloadorg.eclipse.cdt-e1b227f33885c877f1f6c161bc400a521399382a.tar.gz
org.eclipse.cdt-e1b227f33885c877f1f6c161bc400a521399382a.tar.xz
org.eclipse.cdt-e1b227f33885c877f1f6c161bc400a521399382a.zip
Added IIndexFile.toDebugString method.
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IIndexFile.java8
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMFile.java31
2 files changed, 38 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IIndexFile.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IIndexFile.java
index 6e7f3042ae4..257e1647451 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IIndexFile.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IIndexFile.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2011 Wind River Systems, Inc. and others.
+ * Copyright (c) 2006, 2012 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
@@ -98,4 +98,10 @@ public interface IIndexFile extends IFileNomination {
* @since 5.0
*/
int getLinkageID() throws CoreException;
+
+ /**
+ * Returns detailed information about the file. For debugging only.
+ * @since 5.4
+ */
+ String toDebugString();
}
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMFile.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMFile.java
index f2a399c0ada..816e1dbcbb1 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMFile.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMFile.java
@@ -938,4 +938,35 @@ public class PDOMFile implements IIndexFragmentFile {
}
return loc != null ? loc.toString() : super.toString();
}
+
+ @Override
+ public String toDebugString() {
+ StringBuilder buf = new StringBuilder();
+ try {
+ buf.append("location: "); //$NON-NLS-1$
+ buf.append(getLocation());
+ buf.append(", timestamp: "); //$NON-NLS-1$
+ buf.append(getTimestamp());
+ buf.append(", linkageID: "); //$NON-NLS-1$
+ buf.append(getLinkageID());
+ buf.append(", contentsHash: "); //$NON-NLS-1$
+ buf.append(getContentsHash());
+ IIndexInclude parsedInContext = getParsedInContext();
+ if (parsedInContext != null) {
+ buf.append(", parsedInContext: "); //$NON-NLS-1$
+ buf.append(parsedInContext.getIncludedBy());
+ }
+ buf.append(", significantMacros: "); //$NON-NLS-1$
+ buf.append(getSignificantMacros());
+ buf.append(", names: "); //$NON-NLS-1$
+ buf.append(findNames(0, Integer.MAX_VALUE).length);
+ buf.append(", macros: "); //$NON-NLS-1$
+ buf.append(getMacros().length);
+ buf.append(", includes: "); //$NON-NLS-1$
+ buf.append(getIncludes().length);
+ } catch (CoreException e) {
+ buf.append(" (incomplete due to " + e.getClass().getName() + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ return buf.toString();
+ }
}

Back to the top