diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/AbstractCharArray.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/AbstractCharArray.java index 794ffeb72f7..984b63cdb4b 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/AbstractCharArray.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/AbstractCharArray.java @@ -53,4 +53,16 @@ public abstract class AbstractCharArray { * range checks. */ public abstract void arraycopy(int offset, char[] destination, int destinationPos, int length); + + /** + * This method is slow. Use only for debugging. + */ + @Override + public String toString() { + StringBuilder buf = new StringBuilder(); + for (int pos = 0; isValidOffset(pos); pos++) { + buf.append(get(pos)); + } + return buf.toString(); + } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/InternalFileContent.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/InternalFileContent.java index 81eeb4ac38e..ccfacf5ece7 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/InternalFileContent.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/scanner/InternalFileContent.java @@ -182,4 +182,12 @@ public class InternalFileContent extends FileContent { public void setFoundOnPath(IncludeSearchPathElement isp) { fFoundOnPath= isp; } + + /** + * This method is slow. Use only for debugging. + */ + @Override + public String toString() { + return getSource().toString(); + } }