mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Improved handling of unexpected exceptions in the indexer, related to bug 221796.
This commit is contained in:
parent
0545a83691
commit
fe1f5608eb
2 changed files with 11 additions and 9 deletions
|
@ -626,7 +626,11 @@ public abstract class AbstractIndexerTask extends PDOMWriter {
|
||||||
}
|
}
|
||||||
|
|
||||||
IIndexFileLocation[] ifls= orderedIFLs.toArray(new IIndexFileLocation[orderedIFLs.size()]);
|
IIndexFileLocation[] ifls= orderedIFLs.toArray(new IIndexFileLocation[orderedIFLs.size()]);
|
||||||
|
try {
|
||||||
addSymbols(ast, ifls, fIndex, 1, false, configHash, fTodoTaskUpdater, pm);
|
addSymbols(ast, ifls, fIndex, 1, false, configHash, fTodoTaskUpdater, pm);
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
// mark as updated in any case, to avoid parsing files that caused an exception to be thrown.
|
||||||
for (IIndexFileLocation ifl : ifls) {
|
for (IIndexFileLocation ifl : ifls) {
|
||||||
info= getFileInfo(linkageID, ifl);
|
info= getFileInfo(linkageID, ifl);
|
||||||
assert info != null;
|
assert info != null;
|
||||||
|
@ -635,6 +639,7 @@ public abstract class AbstractIndexerTask extends PDOMWriter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void collectOrderedIFLs(final int linkageID, IASTInclusionNode inclusion, HashSet<IIndexFileLocation> enteredFiles, ArrayList<IIndexFileLocation> orderedIFLs) throws CoreException {
|
private void collectOrderedIFLs(final int linkageID, IASTInclusionNode inclusion, HashSet<IIndexFileLocation> enteredFiles, ArrayList<IIndexFileLocation> orderedIFLs) throws CoreException {
|
||||||
final IASTPreprocessorIncludeStatement id= inclusion.getIncludeDirective();
|
final IASTPreprocessorIncludeStatement id= inclusion.getIncludeDirective();
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.core.pdom;
|
package org.eclipse.cdt.internal.core.pdom;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -199,11 +198,9 @@ abstract public class PDOMWriter {
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
stati.add(CCorePlugin.createStatus(
|
stati.add(CCorePlugin.createStatus(
|
||||||
NLS.bind(Messages.PDOMWriter_errorWhileParsing, ifl.getURI().getPath()), e));
|
NLS.bind(Messages.PDOMWriter_errorWhileParsing, ifl.getURI().getPath()), e));
|
||||||
break;
|
|
||||||
} catch (PDOMNotImplementedError e) {
|
} catch (PDOMNotImplementedError e) {
|
||||||
stati.add(CCorePlugin.createStatus(
|
stati.add(CCorePlugin.createStatus(
|
||||||
NLS.bind(Messages.PDOMWriter_errorWhileParsing, ifl.getURI().getPath()), e));
|
NLS.bind(Messages.PDOMWriter_errorWhileParsing, ifl.getURI().getPath()), e));
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
if (i<ifls.length-1) {
|
if (i<ifls.length-1) {
|
||||||
updateFileCount(0, 0, 1); // update header count
|
updateFileCount(0, 0, 1); // update header count
|
||||||
|
|
Loading…
Add table
Reference in a new issue