diff --git a/build/org.eclipse.cdt.gnu.build-feature/pom.xml b/build/org.eclipse.cdt.gnu.build-feature/pom.xml index 3f346e92611..2fa1e844ea7 100644 --- a/build/org.eclipse.cdt.gnu.build-feature/pom.xml +++ b/build/org.eclipse.cdt.gnu.build-feature/pom.xml @@ -11,6 +11,6 @@ ../../pom.xml - org.eclipse.cdt.gnu.build-feature + org.eclipse.cdt.gnu.build eclipse-feature diff --git a/build/org.eclipse.cdt.gnu.build.source-feature/.project b/build/org.eclipse.cdt.gnu.build.source-feature/.project new file mode 100644 index 00000000000..de91d0ffbf7 --- /dev/null +++ b/build/org.eclipse.cdt.gnu.build.source-feature/.project @@ -0,0 +1,17 @@ + + + org.eclipse.cdt.gnu.build.source-feature + + + + + + org.eclipse.pde.FeatureBuilder + + + + + + org.eclipse.pde.FeatureNature + + diff --git a/build/org.eclipse.cdt.gnu.build.source-feature/pom.xml b/build/org.eclipse.cdt.gnu.build.source-feature/pom.xml index c6e6e2d2705..af16118eb22 100644 --- a/build/org.eclipse.cdt.gnu.build.source-feature/pom.xml +++ b/build/org.eclipse.cdt.gnu.build.source-feature/pom.xml @@ -11,6 +11,6 @@ ../../pom.xml - org.eclipse.cdt.gnu.build.source-feature + org.eclipse.cdt.gnu.build.source eclipse-feature diff --git a/codan/org.eclipse.cdt.codan.checkers/OSGI-INF/l10n/bundle.properties b/codan/org.eclipse.cdt.codan.checkers/OSGI-INF/l10n/bundle.properties index a59ba9ebebb..e25a9205617 100644 --- a/codan/org.eclipse.cdt.codan.checkers/OSGI-INF/l10n/bundle.properties +++ b/codan/org.eclipse.cdt.codan.checkers/OSGI-INF/l10n/bundle.properties @@ -52,7 +52,7 @@ problem.name.FormatString = Format String Vulnerability checker.name.AssignmentToItself = Assignment to itself problem.messagePattern.AssignmentToItself = Assignment to itself ''{0}'' problem.name.AssignmentToItself = Assignment to itself -problem.description.AssignmentToItself = Finds expression where left and right side of the assignment is the same, i.e. 'var = var' +problem.description.AssignmentToItself = Finds expression where left and right sides of the assignment are the same, i.e. 'var = var' checker.name.ReturnStyle = Return with parenthesis problem.name.ReturnStyle = Return with parenthesis problem.messagePattern.ReturnStyle = Return statement has invalid style. Return value should be surrounded by parenthesis @@ -60,10 +60,10 @@ problem.description.ReturnStyle = Checks for return statements that do no return checker.name.SuspiciousSemicolon = Suspicious semicolon problem.name.SuspiciousSemicolon = Suspicious semicolon problem.messagePattern.SuspiciousSemicolon = Suspicious semicolon -problem.description.SuspiciousSemicolon = A semicolon is used as a null statement in a condition. For example, 'if(expression);' +problem.description.SuspiciousSemicolon = A semicolon is used as a null statement in a condition. For example, 'if (expression);' checker.name.CaseBreak = No break at end of case problem.description.CaseBreak = Looks for "case" statements which end without a "break" statement -problem.messagePattern.CaseBreak = No break at the end of this case +problem.messagePattern.CaseBreak = No break at the end of case binding.checker.name = Problem Binding Checker problem.description.G = Name resolution problem found by the indexer problem.messagePattern.G = Symbol ''{0}'' could not be resolved diff --git a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/AbstractClassInstantiationChecker.java b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/AbstractClassInstantiationChecker.java index 41714eb89bc..8b5e66ceb3d 100644 --- a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/AbstractClassInstantiationChecker.java +++ b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/AbstractClassInstantiationChecker.java @@ -7,6 +7,7 @@ * * Contributors: * Anton Gorenkov - initial implementation + * Sergey Prigogin (Google) *******************************************************************************/ package org.eclipse.cdt.codan.internal.checkers; @@ -30,6 +31,7 @@ import org.eclipse.cdt.core.dom.ast.IASTParameterDeclaration; import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration; import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; import org.eclipse.cdt.core.dom.ast.IBinding; +import org.eclipse.cdt.core.dom.ast.IProblemBinding; import org.eclipse.cdt.core.dom.ast.IType; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionCallExpression; import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTNamedTypeSpecifier; @@ -179,22 +181,23 @@ public class AbstractClassInstantiationChecker extends AbstractIndexAstChecker { } /** - * Checks whether specified type (class or typedef to the class) is abstract class. - * If it is - reports violations on each pure virtual method + * Checks whether specified type (class or typedef to the class) is an abstract class. + * If it is, reports violations on each pure virtual method */ private void reportProblemsIfAbstract(IType typeToCheck, IASTNode problemNode ) { IType unwindedType = CxxAstUtils.getInstance().unwindTypedef(typeToCheck); - if (unwindedType instanceof ICPPClassType) { - ICPPClassType classType = (ICPPClassType) unwindedType; - ICPPMethod[] pureVirtualMethods = pureVirtualMethodsCache.get(classType); - if (pureVirtualMethods == null) { - pureVirtualMethods = ClassTypeHelper.getPureVirtualMethods(classType); - pureVirtualMethodsCache.put(classType, pureVirtualMethods); - } - - for (ICPPMethod method : pureVirtualMethods) { - reportProblem(ER_ID, problemNode, resolveName(classType), resolveName(method)); - } + if (!(unwindedType instanceof ICPPClassType) || unwindedType instanceof IProblemBinding) { + return; + } + ICPPClassType classType = (ICPPClassType) unwindedType; + ICPPMethod[] pureVirtualMethods = pureVirtualMethodsCache.get(classType); + if (pureVirtualMethods == null) { + pureVirtualMethods = ClassTypeHelper.getPureVirtualMethods(classType); + pureVirtualMethodsCache.put(classType, pureVirtualMethods); + } + + for (ICPPMethod method : pureVirtualMethods) { + reportProblem(ER_ID, problemNode, resolveName(classType), resolveName(method)); } } } diff --git a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/CaseBreakChecker.java b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/CaseBreakChecker.java index dfd564bbb40..20da627cbc6 100644 --- a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/CaseBreakChecker.java +++ b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/CaseBreakChecker.java @@ -1,13 +1,14 @@ /******************************************************************************* - * Copyright (c) 2010,2011 Gil Barash + * Copyright (c) 2010, 2011 Gil Barash * 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 * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Gil Barash - Initial implementation - * Elena laskavaia - Rewrote checker to reduce false positives in complex cases + * Gil Barash - Initial implementation + * Elena laskavaia - Rewrote checker to reduce false positives in complex cases + * Sergey Prigogin (Google) *******************************************************************************/ package org.eclipse.cdt.codan.internal.checkers; @@ -50,8 +51,7 @@ public class CaseBreakChecker extends AbstractIndexAstChecker implements IChecke } /** - * This visitor looks for "switch" statements and invokes "SwitchVisitor" on - * them. + * This visitor looks for "switch" statements and invokes "SwitchVisitor" on them. */ class SwitchFindingVisitor extends ASTVisitor { SwitchFindingVisitor() { @@ -67,7 +67,7 @@ public class CaseBreakChecker extends AbstractIndexAstChecker implements IChecke * - "continue" * - "goto" (does not check that the goto actually exists the * switch) - * - "thorw" + * - "throw" * - "exit" */ protected boolean isBreakOrExitStatement(IASTStatement statement) { @@ -83,7 +83,7 @@ public class CaseBreakChecker extends AbstractIndexAstChecker implements IChecke IASTSwitchStatement switchStmt = (IASTSwitchStatement) statement; IASTStatement body = switchStmt.getBody(); if (body instanceof IASTCompoundStatement) { - // if not it is not really a switch + // If not it is not really a switch IASTStatement[] statements = ((IASTCompoundStatement) body).getStatements(); IASTStatement prevCase = null; for (int i = 0; i < statements.length; i++) { @@ -97,16 +97,16 @@ public class CaseBreakChecker extends AbstractIndexAstChecker implements IChecke if (isCaseStatement(curr)) { prevCase = curr; } - // next is case or end of switch - means this one is the last + // Next is case or end of switch - means this one is the last if (prevCase != null && (isCaseStatement(next) || next == null)) { - // check that current statement end with break or any other exit statement + // Check that current statement end with break or any other exit statement if (!_checkEmptyCase && isCaseStatement(curr) && next != null) { - continue; // empty case & we don't care + continue; // Empty case and we don't care } if (!_checkLastCase && next == null) { - continue; // last case and we don't care + continue; // Last case and we don't care } - if (isFallThroughStamement(curr)) { + if (!isProducedByMacroExpansion(prevCase) && isFallThroughStamement(curr)) { IASTComment comment = null; if (next != null) { comment = getLeadingComment(next); @@ -139,7 +139,7 @@ public class CaseBreakChecker extends AbstractIndexAstChecker implements IChecke } /** - * @param nextstatement + * @param body * @return */ public boolean isFallThroughStamement(IASTStatement body) { @@ -171,13 +171,11 @@ public class CaseBreakChecker extends AbstractIndexAstChecker implements IChecke IASTFileLocation astLocation = astNode.getFileLocation(); int line = astLocation.getEndingLineNumber(); IProblemLocationFactory locFactory = getRuntime().getProblemLocationFactory(); - return locFactory.createProblemLocation(getFile(), -1, - -1, line); + return locFactory.createProblemLocation(getFile(), -1, -1, line); } /** - * Checks if the given statement is a result of macro expansion with a - * possible + * Checks if the given statement is a result of macro expansion with a possible * exception for the trailing semicolon. * * @param statement the statement to check. diff --git a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/CheckersMessages.properties b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/CheckersMessages.properties index 6ba43171f76..44fcb0651d3 100644 --- a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/CheckersMessages.properties +++ b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/CheckersMessages.properties @@ -9,17 +9,17 @@ # Alena Laskavaia - initial API and implementation ############################################################################### CaseBreakChecker_DefaultNoBreakCommentDescription=Comment text to suppress the problem: -CaseBreakChecker_EmptyCaseDescription=Check also empty case statement (except if last) -CaseBreakChecker_LastCaseDescription=Check also the last case statement +CaseBreakChecker_EmptyCaseDescription=Check also empty 'case' statement (except if last) +CaseBreakChecker_LastCaseDescription=Check also the last 'case' statement CatchByReference_ReportForUnknownType=Report a problem if type cannot be resolved NamingConventionFunctionChecker_LabelNamePattern=Name Pattern NamingConventionFunctionChecker_ParameterMethods=Also check C++ method names ReturnChecker_Param0=Also check functions with implicit return value GenericParameter_ParameterExceptions=Exceptions (value of the problem argument) GenericParameter_ParameterExceptionsItem=Value of the argument -StatementHasNoEffectChecker_ParameterMacro=Report problem in statements that comes from macro expansion -SuggestedParenthesisChecker_SuggestParanthesesAroundNot=Suggest parenthesis around not operator -SuspiciousSemicolonChecker_ParamAfterElse=Report an error if semicolon is right after else statement +StatementHasNoEffectChecker_ParameterMacro=Report problem in statements that come from macro expansion +SuggestedParenthesisChecker_SuggestParanthesesAroundNot=Suggest parenthesis around 'not' operator +SuspiciousSemicolonChecker_ParamAfterElse=Report an error if semicolon is right after 'else' statement SuspiciousSemicolonChecker_ParamElse=Do not report an error after 'if' when 'else' exists ProblemBindingChecker_Candidates=Candidates are: diff --git a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/StatementHasNoEffectChecker.java b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/StatementHasNoEffectChecker.java index ed023fb8870..f1d39829241 100644 --- a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/StatementHasNoEffectChecker.java +++ b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/StatementHasNoEffectChecker.java @@ -57,9 +57,7 @@ public class StatementHasNoEffectChecker extends AbstractIndexAstChecker { if (stmt instanceof IASTExpressionStatement) { IASTExpression expression = ((IASTExpressionStatement) stmt).getExpression(); if (hasNoEffect(expression)) { - boolean inMacro = CxxAstUtils.getInstance().isInMacro(expression); - boolean shouldReportInMacro = shouldReportInMacro(); - if (inMacro && !shouldReportInMacro) + if (!shouldReportInMacro() && CxxAstUtils.isInMacro(expression)) return PROCESS_SKIP; String arg = expression.getRawSignature(); if (!isFilteredArg(arg)) diff --git a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/UnusedSymbolInFileScopeChecker.java b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/UnusedSymbolInFileScopeChecker.java index 8ef51bdcf2b..54390de9ece 100644 --- a/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/UnusedSymbolInFileScopeChecker.java +++ b/codan/org.eclipse.cdt.codan.checkers/src/org/eclipse/cdt/codan/internal/checkers/UnusedSymbolInFileScopeChecker.java @@ -6,7 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Andrew Gvozdev - initial API and implementation + * Andrew Gvozdev - initial API and implementation + * Sergey Prigogin (Google) *******************************************************************************/ package org.eclipse.cdt.codan.internal.checkers; @@ -18,6 +19,7 @@ import java.util.Map; import java.util.Map.Entry; import org.eclipse.cdt.codan.checkers.CodanCheckersActivator; +import org.eclipse.cdt.codan.core.cxx.CxxAstUtils; import org.eclipse.cdt.codan.core.cxx.model.AbstractIndexAstChecker; import org.eclipse.cdt.codan.core.model.IProblem; import org.eclipse.cdt.codan.core.model.IProblemWorkingCopy; @@ -54,6 +56,7 @@ public class UnusedSymbolInFileScopeChecker extends AbstractIndexAstChecker { public static final String ER_UNUSED_VARIABLE_DECLARATION_ID = "org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem"; //$NON-NLS-1$ public static final String ER_UNUSED_FUNCTION_DECLARATION_ID = "org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem"; //$NON-NLS-1$ public static final String ER_UNUSED_STATIC_FUNCTION_ID = "org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem"; //$NON-NLS-1$ + public static final String PARAM_MACRO_ID = "macro"; //$NON-NLS-1$ public static final String PARAM_EXCEPT_ARG_LIST = "exceptions"; //$NON-NLS-1$ private Map externFunctionDeclarations = new HashMap(); @@ -71,6 +74,7 @@ public class UnusedSymbolInFileScopeChecker extends AbstractIndexAstChecker { @Override public void initPreferences(IProblemWorkingCopy problem) { super.initPreferences(problem); + addPreference(problem, PARAM_MACRO_ID, CheckersMessages.StatementHasNoEffectChecker_ParameterMacro, Boolean.TRUE); if (problem.getId().equals(ER_UNUSED_VARIABLE_DECLARATION_ID)) { unusedVariableProblem = problem; ListProblemPreference pref = addListPreference(problem, PARAM_EXCEPT_ARG_LIST, @@ -90,11 +94,11 @@ public class UnusedSymbolInFileScopeChecker extends AbstractIndexAstChecker { } private boolean isAnyCandidate() { - return externFunctionDeclarations.size() > 0 || - staticFunctionDeclarations.size() > 0 || - staticFunctionDefinitions.size() > 0 || - externVariableDeclarations.size() > 0 || - staticVariableDeclarations.size() > 0; + return !externFunctionDeclarations.isEmpty() || + !staticFunctionDeclarations.isEmpty() || + !staticFunctionDefinitions.isEmpty() || + !externVariableDeclarations.isEmpty() || + !staticVariableDeclarations.isEmpty(); } public void processAst(IASTTranslationUnit ast) { @@ -131,42 +135,51 @@ public class UnusedSymbolInFileScopeChecker extends AbstractIndexAstChecker { int storageClass = simpleDeclaration.getDeclSpecifier().getStorageClass(); if (binding instanceof IFunction) { - if (storageClass == IASTDeclSpecifier.sc_extern || storageClass == IASTDeclSpecifier.sc_unspecified) { - externFunctionDeclarations.put(binding, decl); - } else if (storageClass == IASTDeclSpecifier.sc_static) { - staticFunctionDeclarations.put(binding, decl); - } - } else if (binding instanceof IVariable) { - if (storageClass == IASTDeclSpecifier.sc_extern) { - IASTInitializer initializer = decl.getInitializer(); - // initializer makes "extern" declaration to become definition do not count these - if (initializer==null) { - externVariableDeclarations.put(binding, decl); + if (storageClass == IASTDeclSpecifier.sc_extern || + storageClass == IASTDeclSpecifier.sc_unspecified) { + if (shouldReportInMacro(ER_UNUSED_FUNCTION_DECLARATION_ID) || + !CxxAstUtils.isInMacro(astName)) { + externFunctionDeclarations.put(binding, decl); } } else if (storageClass == IASTDeclSpecifier.sc_static) { - IType type = ((IVariable) binding).getType(); - // account for class constructor and avoid possible false positive - if (!(type instanceof ICPPClassType) && !(type instanceof IProblemType)) { - // check if initializer disqualifies it - IASTInitializer initializer = decl.getInitializer(); - IASTInitializerClause clause = null; - if (initializer instanceof IASTEqualsInitializer) { - IASTEqualsInitializer equalsInitializer = (IASTEqualsInitializer) initializer; - clause = equalsInitializer.getInitializerClause(); - } else if (initializer instanceof ICPPASTConstructorInitializer) { - ICPPASTConstructorInitializer constructorInitializer = (ICPPASTConstructorInitializer) initializer; - IASTInitializerClause[] args = constructorInitializer.getArguments(); - if (args.length==1) - clause = args[0]; + if (shouldReportInMacro(ER_UNUSED_STATIC_FUNCTION_ID) || + !CxxAstUtils.isInMacro(astName)) { + staticFunctionDeclarations.put(binding, decl); + } + } + } else if (binding instanceof IVariable) { + if (shouldReportInMacro(ER_UNUSED_VARIABLE_DECLARATION_ID) || + !CxxAstUtils.isInMacro(astName)) { + if (storageClass == IASTDeclSpecifier.sc_extern) { + // Initializer makes "extern" declaration to become definition do not count these + if (decl.getInitializer() == null) { + externVariableDeclarations.put(binding, decl); } - if (clause instanceof IASTLiteralExpression) { - IASTLiteralExpression literalExpression = (IASTLiteralExpression) clause; - String literal = literalExpression.toString(); - if (isFilteredOut(literal, unusedVariableProblem, PARAM_EXCEPT_ARG_LIST)) - continue; + } else if (storageClass == IASTDeclSpecifier.sc_static) { + IType type = ((IVariable) binding).getType(); + // Account for class constructor and avoid possible false positive + if (!(type instanceof ICPPClassType) && !(type instanceof IProblemType)) { + // Check if initializer disqualifies it + IASTInitializer initializer = decl.getInitializer(); + IASTInitializerClause clause = null; + if (initializer instanceof IASTEqualsInitializer) { + IASTEqualsInitializer equalsInitializer = (IASTEqualsInitializer) initializer; + clause = equalsInitializer.getInitializerClause(); + } else if (initializer instanceof ICPPASTConstructorInitializer) { + ICPPASTConstructorInitializer constructorInitializer = (ICPPASTConstructorInitializer) initializer; + IASTInitializerClause[] args = constructorInitializer.getArguments(); + if (args.length == 1) + clause = args[0]; + } + if (clause instanceof IASTLiteralExpression) { + IASTLiteralExpression literalExpression = (IASTLiteralExpression) clause; + String literal = literalExpression.toString(); + if (isFilteredOut(literal, unusedVariableProblem, PARAM_EXCEPT_ARG_LIST)) + continue; + } + + staticVariableDeclarations.put(binding, decl); } - - staticVariableDeclarations.put(binding, decl); } } } @@ -232,7 +245,12 @@ public class UnusedSymbolInFileScopeChecker extends AbstractIndexAstChecker { staticFunctionDefinitions.remove(binding); } - if (!(parentNode instanceof IASTDeclarator)) { + if (parentNode instanceof IASTDeclarator) { + // Initializer makes "extern" declaration to become definition. + if (((IASTDeclarator) parentNode).getInitializer() != null) { + externVariableDeclarations.remove(binding); + } + } else { externVariableDeclarations.remove(binding); staticVariableDeclarations.remove(binding); } @@ -310,7 +328,7 @@ public class UnusedSymbolInFileScopeChecker extends AbstractIndexAstChecker { clearCandidates(); // release memory } - public boolean isFilteredOut(String arg, IProblem problem, String exceptionListParamId) { + private boolean isFilteredOut(String arg, IProblem problem, String exceptionListParamId) { Object[] arr = (Object[]) getPreference(problem, exceptionListParamId); for (int i = 0; i < arr.length; i++) { String str = (String) arr[i]; @@ -320,4 +338,7 @@ public class UnusedSymbolInFileScopeChecker extends AbstractIndexAstChecker { return false; } + private boolean shouldReportInMacro(String errorId) { + return (Boolean) getPreference(getProblemById(errorId, getFile()), PARAM_MACRO_ID); + } } diff --git a/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/CxxAstUtils.java b/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/CxxAstUtils.java index b297756c364..e7214b3016d 100644 --- a/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/CxxAstUtils.java +++ b/codan/org.eclipse.cdt.codan.core.cxx/src/org/eclipse/cdt/codan/core/cxx/CxxAstUtils.java @@ -121,7 +121,7 @@ public final class CxxAstUtils { return (IType) typeName; } - public boolean isInMacro(IASTNode node) { + public static boolean isInMacro(IASTNode node) { IASTNodeSelector nodeSelector = node.getTranslationUnit().getNodeSelector(node.getTranslationUnit().getFilePath()); IASTFileLocation fileLocation = node.getFileLocation(); IASTPreprocessorMacroExpansion macro = nodeSelector.findEnclosingMacroExpansion(fileLocation.getNodeOffset(), diff --git a/codan/org.eclipse.cdt.codan.core.test/pom.xml b/codan/org.eclipse.cdt.codan.core.test/pom.xml index 7e3644fc28a..8162828c0ef 100644 --- a/codan/org.eclipse.cdt.codan.core.test/pom.xml +++ b/codan/org.eclipse.cdt.codan.core.test/pom.xml @@ -12,7 +12,7 @@ 1.0.0-SNAPSHOT - org.eclipse.cdt.codan.core.tests + org.eclipse.cdt.codan.core.test eclipse-test-plugin diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/CaseBreakCheckerTest.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/CaseBreakCheckerTest.java index 083aff6960c..92799531245 100644 --- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/CaseBreakCheckerTest.java +++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/CaseBreakCheckerTest.java @@ -6,7 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Gil Barash - Initial implementation + * Gil Barash - Initial implementation + * Sergey Prigogin (Google) *******************************************************************************/ package org.eclipse.cdt.codan.core.internal.checkers; @@ -383,11 +384,11 @@ public class CaseBreakCheckerTest extends CheckerTestCase { } // void foo(void) { - // int a, b; - // switch( a ) { - // case 1: - // b = 2; - // } + // int a, b; + // switch( a ) { + // case 1: + // b = 2; + // } // } public void testLastCaseIgnore() { setLast(false); @@ -474,12 +475,12 @@ public class CaseBreakCheckerTest extends CheckerTestCase { } // void foo(void) { - // int a; - // switch( a ) { - // case 2: + // int a; + // switch( a ) { + // case 2: // break; - // case 1: - // } + // case 1: + // } // } public void testEmptyLastCaseError() { String code = getAboveComment(); @@ -493,31 +494,32 @@ public class CaseBreakCheckerTest extends CheckerTestCase { } // void foo(int a) { - // switch( a ) { - // case 2: + // switch( a ) { + // case 2: // if (a*2<10) - // return; + // return; // else - // break; - // case 1: - // break; - // } + // break; + // case 1: + // break; + // } // } public void testIf() { String code = getAboveComment(); loadCodeAndRun(code); checkNoErrors(); } + // void foo(int a) { - // switch( a ) { - // case 2: + // switch(a) { + // case 2: // if (a*2<10) - // return; + // return; // else - // a++; - // case 1: - // break; - // } + // a++; + // case 1: + // break; + // } // } public void testIfErr() { String code = getAboveComment(); @@ -525,53 +527,43 @@ public class CaseBreakCheckerTest extends CheckerTestCase { checkErrorLine(7); } -// #define DEFINE_BREAK {break;} -// void foo ( int a ) -// { -// switch ( a ) -// { -// case 1: -// DEFINE_BREAK // <-- Warning: No break at the end of this case -// } -// } + // #define DEFINE_BREAK {break;} + // void foo(int a) { + // switch (a) { + // case 1: + // DEFINE_BREAK // No warning here + // } + // } public void testBreakInBraces() { String code = getAboveComment(); loadCodeAndRun(code); checkNoErrors(); } - -// #define MY_MACRO(i) \ -// case i: \ -// { \ -// break; \ -// } -// -// void f() -// { -// int x; -// switch (x) -// { -// MY_MACRO(1) // WARNING HERE -// } -// } - + // #define MY_MACRO(i) \ + // case i: { \ + // } + // + // void f() { + // int x; + // switch (x) { + // MY_MACRO(1) // No warning here + // } + // } public void testInMacro() { String code = getAboveComment(); loadCodeAndRun(code); checkNoErrors(); } - //void foo() - //{ - //switch(0) - //default: - //{ - //} - //} - public void testEmptyCompoundStatement() { - String code = getAboveComment(); - loadCodeAndRun(code); - checkErrorLine(6); - } + // void foo() { + // switch (0) + // default: { + // } + // } + public void testEmptyCompoundStatement() { + String code = getAboveComment(); + loadCodeAndRun(code); + checkErrorLine(4); + } } diff --git a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/UnusedSymbolInFileScopeCheckerTest.java b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/UnusedSymbolInFileScopeCheckerTest.java index 7206e8b7852..4cd1d7964fa 100644 --- a/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/UnusedSymbolInFileScopeCheckerTest.java +++ b/codan/org.eclipse.cdt.codan.core.test/src/org/eclipse/cdt/codan/core/internal/checkers/UnusedSymbolInFileScopeCheckerTest.java @@ -6,7 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Andrew Gvozdev - initial API and implementation + * Andrew Gvozdev - initial API and implementation + * Sergey Prigogin (Google) *******************************************************************************/ package org.eclipse.cdt.codan.core.internal.checkers; @@ -17,7 +18,6 @@ import org.eclipse.cdt.codan.internal.checkers.UnusedSymbolInFileScopeChecker; /** * Test for {@see UnusedSymbolInFileScopeChecker} class - * */ public class UnusedSymbolInFileScopeCheckerTest extends CheckerTestCase { @Override @@ -222,8 +222,15 @@ public class UnusedSymbolInFileScopeCheckerTest extends CheckerTestCase { checkNoErrors(); } - // extern int test_var=0; // not quite legal but some compilers allow that - public void testExternVariable_Definition() throws IOException { + // extern const int test_var=0; // not quite legal but some compilers allow that + public void testExternVariable_Definition1() throws IOException { + loadCodeAndRun(getAboveComment()); + checkNoErrors(); + } + + // extern const int test_var; + // const int test_var = 0; + public void testExternVariable_Definition2() throws IOException { loadCodeAndRun(getAboveComment()); checkNoErrors(); } diff --git a/core/org.eclipse.cdt.core.aix/build.properties b/core/org.eclipse.cdt.core.aix/build.properties index 60ff641b21e..1c593888d45 100644 --- a/core/org.eclipse.cdt.core.aix/build.properties +++ b/core/org.eclipse.cdt.core.aix/build.properties @@ -8,9 +8,9 @@ # Contributors: # IBM Corporation - initial API and implementation ############################################################################### -source.cdtaix.jar = src/ +source.. = src/ bin.includes = fragment.xml,\ - cdtaix.jar,\ + .,\ about.html,\ META-INF/,\ os/ diff --git a/core/org.eclipse.cdt.core.aix/cdtaix.jar b/core/org.eclipse.cdt.core.aix/cdtaix.jar deleted file mode 100644 index 4736cf86eda..00000000000 Binary files a/core/org.eclipse.cdt.core.aix/cdtaix.jar and /dev/null differ diff --git a/core/org.eclipse.cdt.core.linux/build.properties b/core/org.eclipse.cdt.core.linux/build.properties index 0fb31b9d170..6542e91cbdf 100644 --- a/core/org.eclipse.cdt.core.linux/build.properties +++ b/core/org.eclipse.cdt.core.linux/build.properties @@ -10,8 +10,8 @@ ############################################################################### bin.includes = fragment.xml,\ about.html,\ - cdt_linux.jar,\ + .,\ META-INF/ src.includes = about.html,\ library/ -source.cdt_linux.jar = src/ +source.. = src/ diff --git a/core/org.eclipse.cdt.core.linux/cdt_linux.jar b/core/org.eclipse.cdt.core.linux/cdt_linux.jar deleted file mode 100644 index d08df0a9af6..00000000000 Binary files a/core/org.eclipse.cdt.core.linux/cdt_linux.jar and /dev/null differ diff --git a/core/org.eclipse.cdt.core.macosx/build.properties b/core/org.eclipse.cdt.core.macosx/build.properties index dbce6b0a223..fc76b9bff0c 100644 --- a/core/org.eclipse.cdt.core.macosx/build.properties +++ b/core/org.eclipse.cdt.core.macosx/build.properties @@ -10,9 +10,9 @@ ############################################################################### bin.includes = fragment.xml,\ about.html,\ - cdt_macosx.jar,\ + .,\ os/,\ META-INF/ src.includes = about.html,\ library/ -source.cdt_macosx.jar = src/ +source.. = src/ diff --git a/core/org.eclipse.cdt.core.macosx/cdt_macosx.jar b/core/org.eclipse.cdt.core.macosx/cdt_macosx.jar deleted file mode 100644 index e70f582c8d4..00000000000 Binary files a/core/org.eclipse.cdt.core.macosx/cdt_macosx.jar and /dev/null differ diff --git a/core/org.eclipse.cdt.core.solaris/build.properties b/core/org.eclipse.cdt.core.solaris/build.properties index 2d1a77f10b3..682baefa984 100644 --- a/core/org.eclipse.cdt.core.solaris/build.properties +++ b/core/org.eclipse.cdt.core.solaris/build.properties @@ -11,8 +11,8 @@ bin.includes = fragment.xml,\ about.html,\ os/,\ - cdt_solaris.jar,\ + .,\ META-INF/ src.includes = about.html,\ library/ -source.cdt_solaris.jar = src/ +source.. = src/ diff --git a/core/org.eclipse.cdt.core.solaris/cdt_solaris.jar b/core/org.eclipse.cdt.core.solaris/cdt_solaris.jar deleted file mode 100644 index 490f0273d09..00000000000 Binary files a/core/org.eclipse.cdt.core.solaris/cdt_solaris.jar and /dev/null differ diff --git a/core/org.eclipse.cdt.core.tests/pom.xml b/core/org.eclipse.cdt.core.tests/pom.xml index 887a223955e..348e188df82 100644 --- a/core/org.eclipse.cdt.core.tests/pom.xml +++ b/core/org.eclipse.cdt.core.tests/pom.xml @@ -15,6 +15,14 @@ org.eclipse.cdt.core.tests eclipse-test-plugin + + + cdt.repo + file:/${basedir}/../../releng/org.eclipse.cdt.repo/target/repository + p2 + + + @@ -28,6 +36,13 @@ **/AutomatedIntegrationSuite.* true + + + org.eclipse.cdt.feature.group + 8.0.0.${buildQualifier} + p2-installable-unit + + diff --git a/core/org.eclipse.cdt.core.win32/build.properties b/core/org.eclipse.cdt.core.win32/build.properties index 7b3db958ad3..3805517ebdd 100644 --- a/core/org.eclipse.cdt.core.win32/build.properties +++ b/core/org.eclipse.cdt.core.win32/build.properties @@ -10,8 +10,8 @@ ############################################################################### bin.includes = fragment.xml,\ about.html,\ - cdt_win32.jar,\ + .,\ META-INF/ src.includes = about.html,\ library/ -source.cdt_win32.jar = src/ +source.. = src/ diff --git a/core/org.eclipse.cdt.core.win32/cdt_win32.jar b/core/org.eclipse.cdt.core.win32/cdt_win32.jar deleted file mode 100644 index b72115589c3..00000000000 Binary files a/core/org.eclipse.cdt.core.win32/cdt_win32.jar and /dev/null differ diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ClassTypeHelper.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ClassTypeHelper.java index 3c2a28382f9..6b0624416ca 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ClassTypeHelper.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/ClassTypeHelper.java @@ -310,12 +310,13 @@ public class ClassTypeHelper { /** * Returns methods either declared by the given class or generated by the compiler. Does not * include methods declared in base classes. - * @param classType - * @return */ private static ObjectSet getOwnMethods(ICPPClassType classType) { ObjectSet set= new ObjectSet(4); set.addAll(classType.getDeclaredMethods()); + if (classType instanceof IProblemBinding) { + return set; + } ICPPClassScope scope= (ICPPClassScope) classType.getCompositeScope(); set.addAll(scope.getImplicitMethods()); return set; diff --git a/core/org.eclipse.cdt.ui.tests/resources/refactoring/ImplementMethod.rts b/core/org.eclipse.cdt.ui.tests/resources/refactoring/ImplementMethod.rts index ba804a149a3..7fc4d475cc9 100644 --- a/core/org.eclipse.cdt.ui.tests/resources/refactoring/ImplementMethod.rts +++ b/core/org.eclipse.cdt.ui.tests/resources/refactoring/ImplementMethod.rts @@ -838,3 +838,22 @@ void TestClass::foo() { } +//!Bug 355006 - NPE implementing template function +//#org.eclipse.cdt.ui.tests.refactoring.implementmethod.ImplementMethodRefactoringTest +//@.config +filename=A.h +infos=1 +//@A.h + +/*$*/template void func(T&);/*$$*/ + +//= + +template void func(T&); + +template inline void func(T& ) +{ +} + + + diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/ImplementMethodRefactoring.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/ImplementMethodRefactoring.java index bf101d1f1e6..510c842227f 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/ImplementMethodRefactoring.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/implementmethod/ImplementMethodRefactoring.java @@ -260,15 +260,16 @@ public class ImplementMethodRefactoring extends CRefactoring2 { IASTFunctionDefinition functionDefinition = nodeFactory.newFunctionDefinition(declSpecifier, createdMethodDeclarator, nodeFactory.newCompoundStatement()); functionDefinition.setParent(unit); - if (NodeHelper.isContainedInTemplateDeclaration(declarationParent)) { - ICPPASTTemplateDeclaration templateDeclaration = nodeFactory.newTemplateDeclaration(functionDefinition); - templateDeclaration.setParent(unit); + ICPPASTTemplateDeclaration templateDeclaration = NodeHelper.findContainedTemplateDecalaration(declarationParent); + if (templateDeclaration != null) { + ICPPASTTemplateDeclaration newTemplateDeclaration = nodeFactory.newTemplateDeclaration(functionDefinition); + newTemplateDeclaration.setParent(unit); - for (ICPPASTTemplateParameter templateParameter : ((ICPPASTTemplateDeclaration) declarationParent.getParent().getParent() ).getTemplateParameters()) { - templateDeclaration.addTemplateParameter(templateParameter.copy(CopyStyle.withLocations)); + for (ICPPASTTemplateParameter templateParameter : templateDeclaration.getTemplateParameters()) { + newTemplateDeclaration.addTemplateParameter(templateParameter.copy(CopyStyle.withLocations)); } - return templateDeclaration; + return newTemplateDeclaration; } return functionDefinition; } diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/NodeHelper.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/NodeHelper.java index fac66b73716..3aad6f7f999 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/NodeHelper.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/utils/NodeHelper.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2009 Institute for Software, HSR Hochschule fuer Technik + * Copyright (c) 2008, 2011 Institute for Software, HSR Hochschule fuer Technik * Rapperswil, University of applied sciences and others * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -212,11 +212,16 @@ public class NodeHelper { } public static boolean isContainedInTemplateDeclaration(IASTNode node) { - if (node == null) { - return false; - } else if (node instanceof ICPPASTTemplateDeclaration) { - return true; + return findContainedTemplateDecalaration(node) != null; + } + + public static ICPPASTTemplateDeclaration findContainedTemplateDecalaration(IASTNode node) { + while (node != null) { + if (node instanceof ICPPASTTemplateDeclaration) { + return (ICPPASTTemplateDeclaration) node; + } + node = node.getParent(); } - return isContainedInTemplateDeclaration(node.getParent()); + return null; } } diff --git a/cross/org.eclipse.cdt.build.crossgcc-feature/pom.xml b/cross/org.eclipse.cdt.build.crossgcc-feature/pom.xml index 5e69295e395..f3266838a2b 100644 --- a/cross/org.eclipse.cdt.build.crossgcc-feature/pom.xml +++ b/cross/org.eclipse.cdt.build.crossgcc-feature/pom.xml @@ -12,6 +12,7 @@ 1.0.0-SNAPSHOT - org.eclipse.cdt.build.crossgcc-feature + org.eclipse.cdt.features + org.eclipse.cdt.build.crossgcc eclipse-feature diff --git a/debug/org.eclipse.cdt.gdb-feature/pom.xml b/debug/org.eclipse.cdt.gdb-feature/pom.xml index 9557483fafa..37e0cb11ad3 100644 --- a/debug/org.eclipse.cdt.gdb-feature/pom.xml +++ b/debug/org.eclipse.cdt.gdb-feature/pom.xml @@ -11,7 +11,8 @@ ../../pom.xml - org.eclipse.cdt.gdb-feature + org.eclipse.cdt.features + org.eclipse.cdt.gdb eclipse-feature 7.0.0-SNAPSHOT diff --git a/debug/org.eclipse.cdt.gdb.source-feature/.project b/debug/org.eclipse.cdt.gdb.source-feature/.project new file mode 100644 index 00000000000..39edfc3dd84 --- /dev/null +++ b/debug/org.eclipse.cdt.gdb.source-feature/.project @@ -0,0 +1,11 @@ + + + org.eclipse.cdt.gdb.source-feature + + + + + + + + diff --git a/debug/org.eclipse.cdt.gdb.source-feature/pom.xml b/debug/org.eclipse.cdt.gdb.source-feature/pom.xml index 640772e3b98..e3fdacbef54 100644 --- a/debug/org.eclipse.cdt.gdb.source-feature/pom.xml +++ b/debug/org.eclipse.cdt.gdb.source-feature/pom.xml @@ -11,7 +11,7 @@ ../../pom.xml - org.eclipse.cdt.gdb.source-feature + org.eclipse.cdt.gdb.source eclipse-feature 7.0.0-SNAPSHOT diff --git a/debug/org.eclipse.cdt.gnu.debug-feature/pom.xml b/debug/org.eclipse.cdt.gnu.debug-feature/pom.xml index 5398f7632aa..032cc3f120f 100644 --- a/debug/org.eclipse.cdt.gnu.debug-feature/pom.xml +++ b/debug/org.eclipse.cdt.gnu.debug-feature/pom.xml @@ -11,7 +11,7 @@ ../../pom.xml - org.eclipse.cdt.gnu.debug-feature + org.eclipse.cdt.gnu.debug eclipse-feature 7.1.0-SNAPSHOT diff --git a/debug/org.eclipse.cdt.gnu.debug.source-feature/.project b/debug/org.eclipse.cdt.gnu.debug.source-feature/.project new file mode 100644 index 00000000000..711ce10aadf --- /dev/null +++ b/debug/org.eclipse.cdt.gnu.debug.source-feature/.project @@ -0,0 +1,11 @@ + + + org.eclipse.cdt.gnu.debug.source-feature + + + + + + + + diff --git a/debug/org.eclipse.cdt.gnu.debug.source-feature/pom.xml b/debug/org.eclipse.cdt.gnu.debug.source-feature/pom.xml index d3dad153249..24535c68052 100644 --- a/debug/org.eclipse.cdt.gnu.debug.source-feature/pom.xml +++ b/debug/org.eclipse.cdt.gnu.debug.source-feature/pom.xml @@ -11,7 +11,7 @@ ../../pom.xml - org.eclipse.cdt.gnu.debug.source-feature + org.eclipse.cdt.gnu.debug.source eclipse-feature 7.1.0-SNAPSHOT diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/GdbThreadFilterEditor.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/GdbThreadFilterEditor.java index d3206875d7d..3b4ae72dd26 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/GdbThreadFilterEditor.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/GdbThreadFilterEditor.java @@ -24,16 +24,16 @@ import org.eclipse.cdt.dsf.concurrent.Query; import org.eclipse.cdt.dsf.datamodel.DMContexts; import org.eclipse.cdt.dsf.datamodel.IDMContext; import org.eclipse.cdt.dsf.debug.service.IProcesses; -import org.eclipse.cdt.dsf.debug.service.IRunControl; +import org.eclipse.cdt.dsf.debug.service.IProcesses.IProcessDMContext; import org.eclipse.cdt.dsf.debug.service.IProcesses.IThreadDMContext; import org.eclipse.cdt.dsf.debug.service.IProcesses.IThreadDMData; +import org.eclipse.cdt.dsf.debug.service.IRunControl; import org.eclipse.cdt.dsf.debug.service.IRunControl.IContainerDMContext; import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMContext; import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService; import org.eclipse.cdt.dsf.gdb.breakpoints.CBreakpointGdbThreadsFilterExtension; import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin; import org.eclipse.cdt.dsf.gdb.launching.GdbLaunch; -import org.eclipse.cdt.dsf.gdb.service.IGDBBackend; import org.eclipse.cdt.dsf.mi.service.IMIExecutionDMContext; import org.eclipse.cdt.dsf.mi.service.IMIProcesses; import org.eclipse.cdt.dsf.service.DsfServicesTracker; @@ -256,7 +256,7 @@ public class GdbThreadFilterEditor { private void createThreadViewer(Composite parent) { Label label = new Label(parent, SWT.NONE); - label.setText("&Restrict to Selected Targets and Threads:"); //$NON-NLS-1$ + label.setText(Messages.GdbThreadFilterEditor_RestrictToSelected); label.setFont(parent.getFont()); label.setLayoutData(new GridData()); GridData data = new GridData(GridData.FILL_BOTH); @@ -388,7 +388,7 @@ public class GdbThreadFilterEditor { IContainerDMContext[] containerDmcs = (IContainerDMContext[])getData(); rm.setData(containerDmcs); } else { - rm.setStatus(getFailStatus(IDsfStatusConstants.INVALID_STATE, "Wront type of container contexts.")); //$NON-NLS-1$ + rm.setStatus(getFailStatus(IDsfStatusConstants.INVALID_STATE, "Wrong type of container contexts.")); //$NON-NLS-1$ } rm.done(); } @@ -458,7 +458,7 @@ public class GdbThreadFilterEditor { class ContainerLabelQuery extends Query { @Override - protected void execute(DataRequestMonitor rm) { + protected void execute(final DataRequestMonitor rm) { if (!session.isActive()) { rm.setStatus(getFailStatus(IDsfStatusConstants.INVALID_STATE, "Container's session not active.")); //$NON-NLS-1$ rm.done(); @@ -466,13 +466,22 @@ public class GdbThreadFilterEditor { } DsfServicesTracker tracker = new DsfServicesTracker(GdbUIPlugin.getBundleContext(), session.getId()); - IGDBBackend backend = tracker.getService(IGDBBackend.class); - if (backend != null) { - rm.setData(backend.getProgramPath().toOSString()); + IProcesses processService = tracker.getService(IProcesses.class); + IProcessDMContext procDmc = DMContexts.getAncestorOfType(container, IProcessDMContext.class); + if (processService != null && procDmc != null) { + processService.getExecutionData( + procDmc, + new DataRequestMonitor(ImmediateExecutor.getInstance(), rm) { + @Override + public void handleSuccess() { + rm.setData(getData().getName()); + rm.done(); + } + }); } else { - rm.setStatus(getFailStatus(IDsfStatusConstants.INVALID_STATE, "GDB Backend not accessible.")); //$NON-NLS-1$ + rm.setStatus(getFailStatus(IDsfStatusConstants.INVALID_STATE, "Processes service not accessible.")); //$NON-NLS-1$ + rm.done(); } - rm.done(); tracker.dispose(); } } @@ -511,7 +520,8 @@ public class GdbThreadFilterEditor { ImmediateExecutor.getInstance(), rm) { @Override protected void handleSuccess() { - final StringBuilder builder = new StringBuilder("Thread["); //$NON-NLS-1$ + final StringBuilder builder = new StringBuilder(Messages.GdbThreadFilterEditor_Thread); + builder.append("["); //$NON-NLS-1$ builder.append(((IMIExecutionDMContext)thread).getThreadId()); builder.append("] "); //$NON-NLS-1$ builder.append(getData().getId()); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/Messages.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/Messages.java index 2eeb0e892b3..38b8bed6d9c 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/Messages.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/Messages.java @@ -31,7 +31,10 @@ public class Messages extends NLS { public static String TracepointPropertyPage_PassCount; public static String TracepointPropertyPage_Class; public static String TracepointPropertyPage_Enabled; - + + public static String GdbThreadFilterEditor_Thread; + public static String GdbThreadFilterEditor_RestrictToSelected; + static { // initialize resource bundle NLS.initializeMessages(Messages.class.getName(), Messages.class); diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/Messages.properties b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/Messages.properties index 010a6b7dbd6..95a0dd2ac43 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/Messages.properties +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/breakpoints/Messages.properties @@ -29,3 +29,6 @@ TracepointPropertyPage_IgnoreCount=&Ignore count: TracepointPropertyPage_PassCount=&Pass count: TracepointPropertyPage_Class=Class: TracepointPropertyPage_Enabled=Enabled + +GdbThreadFilterEditor_Thread=Thread +GdbThreadFilterEditor_RestrictToSelected=&Restrict to Selected Processes and Threads: \ No newline at end of file diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java index 3b3f673684e..8350f969927 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java @@ -1669,7 +1669,7 @@ public class MIBreakpointsManager extends AbstractDsfService implements IBreakpo // Extract the thread IDs (if there is none, we are covered) for (IContainerDMContext ctxt : targets) { - if (DMContexts.isAncestorOf(ctxt, context)) { + if (ctxt.equals(context) || DMContexts.isAncestorOf(ctxt, context)) { threads.add(filterExtension.getThreadFilters(ctxt)); } } diff --git a/dsf-gdb/org.eclipse.cdt.gnu.dsf-feature/pom.xml b/dsf-gdb/org.eclipse.cdt.gnu.dsf-feature/pom.xml index 9dfaab0d04a..5ffe2566091 100644 --- a/dsf-gdb/org.eclipse.cdt.gnu.dsf-feature/pom.xml +++ b/dsf-gdb/org.eclipse.cdt.gnu.dsf-feature/pom.xml @@ -12,6 +12,6 @@ 4.0.0-SNAPSHOT - org.eclipse.cdt.gdb.dsf-feature + org.eclipse.cdt.gnu.dsf eclipse-feature diff --git a/dsf-gdb/org.eclipse.cdt.gnu.dsf.source-feature/.project b/dsf-gdb/org.eclipse.cdt.gnu.dsf.source-feature/.project new file mode 100644 index 00000000000..6d0324d5e15 --- /dev/null +++ b/dsf-gdb/org.eclipse.cdt.gnu.dsf.source-feature/.project @@ -0,0 +1,11 @@ + + + org.eclipse.cdt.gnu.dsf.source-feature + + + + + + + + diff --git a/dsf-gdb/org.eclipse.cdt.gnu.dsf.source-feature/pom.xml b/dsf-gdb/org.eclipse.cdt.gnu.dsf.source-feature/pom.xml index ec4f9e758ec..e87ca2cfe37 100644 --- a/dsf-gdb/org.eclipse.cdt.gnu.dsf.source-feature/pom.xml +++ b/dsf-gdb/org.eclipse.cdt.gnu.dsf.source-feature/pom.xml @@ -12,6 +12,6 @@ 4.0.0-SNAPSHOT - org.eclipse.cdt.gdb.dsf.source-feature + org.eclipse.cdt.gnu.dsf.source eclipse-feature diff --git a/dsf/org.eclipse.cdt.examples.dsf-feature/pom.xml b/dsf/org.eclipse.cdt.examples.dsf-feature/pom.xml index 4441f062917..a64ad8a12d0 100644 --- a/dsf/org.eclipse.cdt.examples.dsf-feature/pom.xml +++ b/dsf/org.eclipse.cdt.examples.dsf-feature/pom.xml @@ -12,6 +12,7 @@ 2.1.0-SNAPSHOT - org.eclipse.cdt.examples.dsf-feature + org.eclipse.cdt.features + org.eclipse.cdt.examples.dsf eclipse-feature diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag-feature/pom.xml b/jtag/org.eclipse.cdt.debug.gdbjtag-feature/pom.xml index c944e575329..a020ea9615a 100644 --- a/jtag/org.eclipse.cdt.debug.gdbjtag-feature/pom.xml +++ b/jtag/org.eclipse.cdt.debug.gdbjtag-feature/pom.xml @@ -12,6 +12,7 @@ 7.0.0-SNAPSHOT - org.eclipse.cdtdebug.gdbjtag-feature + org.eclipse.cdt.features + org.eclipse.cdt.debug.gdbjtag eclipse-feature diff --git a/lrparser/org.eclipse.cdt.core.lrparser.sdk.feature/pom.xml b/lrparser/org.eclipse.cdt.core.lrparser.sdk.feature/pom.xml index ff465dede44..2f6b972d9b5 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser.sdk.feature/pom.xml +++ b/lrparser/org.eclipse.cdt.core.lrparser.sdk.feature/pom.xml @@ -12,6 +12,6 @@ 5.2.0-SNAPSHOT - org.eclipse.cdt.core.lrparser.sdk.feature + org.eclipse.cdt.core.lrparser.sdk eclipse-feature diff --git a/lrparser/org.eclipse.cdt.core.lrparser.source.feature/pom.xml b/lrparser/org.eclipse.cdt.core.lrparser.source.feature/pom.xml index 4b49629a7ef..e70437ff8d7 100644 --- a/lrparser/org.eclipse.cdt.core.lrparser.source.feature/pom.xml +++ b/lrparser/org.eclipse.cdt.core.lrparser.source.feature/pom.xml @@ -11,7 +11,8 @@ ../../pom.xml + org.eclipse.cdt.features 5.2.0-SNAPSHOT - org.eclipse.cdt.core.lrparser.source.feature + org.eclipse.cdt.core.lrparser.source eclipse-feature diff --git a/memory/org.eclipse.cdt.debug.ui.memory-feature/pom.xml b/memory/org.eclipse.cdt.debug.ui.memory-feature/pom.xml index 2fca78c685c..84938e56c37 100644 --- a/memory/org.eclipse.cdt.debug.ui.memory-feature/pom.xml +++ b/memory/org.eclipse.cdt.debug.ui.memory-feature/pom.xml @@ -12,6 +12,6 @@ 2.1.100-SNAPSHOT - org.eclipse.cdt.debug.ui.memory-feature + org.eclipse.cdt.debug.ui.memory eclipse-feature diff --git a/p2/org.eclipse.cdt.p2-feature/pom.xml b/p2/org.eclipse.cdt.p2-feature/pom.xml index 3016643ba12..2cbde6f9d5e 100644 --- a/p2/org.eclipse.cdt.p2-feature/pom.xml +++ b/p2/org.eclipse.cdt.p2-feature/pom.xml @@ -11,7 +11,8 @@ ../../pom.xml + org.eclipse.cdt.features 1.0.0-SNAPSHOT - org.eclipse.cdt.p2-feature + org.eclipse.cdt.p2 eclipse-feature diff --git a/pom.xml b/pom.xml index d95c11aa363..ce12fd108ca 100644 --- a/pom.xml +++ b/pom.xml @@ -149,6 +149,8 @@ dsf/org.eclipse.cdt.examples.dsf.pda.ui dsf/org.eclipse.cdt.examples.dsf-feature + releng/org.eclipse.cdt.repo + core/org.eclipse.cdt.core.tests core/org.eclipse.cdt.ui.tests build/org.eclipse.cdt.managedbuilder.core.tests @@ -161,7 +163,6 @@ debug/org.eclipse.cdt.debug.ui.tests --> - releng/org.eclipse.cdt.repo diff --git a/releng/org.eclipse.cdt-feature/pom.xml b/releng/org.eclipse.cdt-feature/pom.xml index 6d0c62769e1..028f479703a 100644 --- a/releng/org.eclipse.cdt-feature/pom.xml +++ b/releng/org.eclipse.cdt-feature/pom.xml @@ -11,6 +11,7 @@ ../../pom.xml - org.eclipse.cdt-feature + org.eclipse.cdt.features + org.eclipse.cdt eclipse-feature diff --git a/releng/org.eclipse.cdt.platform-feature/pom.xml b/releng/org.eclipse.cdt.platform-feature/pom.xml index ed7f836a907..0e8e246dc42 100644 --- a/releng/org.eclipse.cdt.platform-feature/pom.xml +++ b/releng/org.eclipse.cdt.platform-feature/pom.xml @@ -11,6 +11,6 @@ ../../pom.xml - org.eclipse.cdt.platform-feature + org.eclipse.cdt.platform eclipse-feature diff --git a/releng/org.eclipse.cdt.platform.source-feature/.project b/releng/org.eclipse.cdt.platform.source-feature/.project new file mode 100644 index 00000000000..80a46454838 --- /dev/null +++ b/releng/org.eclipse.cdt.platform.source-feature/.project @@ -0,0 +1,11 @@ + + + org.eclipse.cdt.platform.source-feature + + + + + + + + diff --git a/releng/org.eclipse.cdt.platform.source-feature/pom.xml b/releng/org.eclipse.cdt.platform.source-feature/pom.xml index 54a16327fea..01bd67f5360 100644 --- a/releng/org.eclipse.cdt.platform.source-feature/pom.xml +++ b/releng/org.eclipse.cdt.platform.source-feature/pom.xml @@ -11,6 +11,6 @@ ../../pom.xml - org.eclipse.cdt.platform.source-feature + org.eclipse.cdt.platform.source eclipse-feature diff --git a/releng/org.eclipse.cdt.repo/pom.xml b/releng/org.eclipse.cdt.repo/pom.xml index e21aa8d8182..f53ed42631c 100644 --- a/releng/org.eclipse.cdt.repo/pom.xml +++ b/releng/org.eclipse.cdt.repo/pom.xml @@ -14,4 +14,47 @@ 8.0.0-SNAPSHOT org.eclipse.cdt.repo eclipse-repository + + + /home/data/httpd/download.eclipse.org/tools/cdt/builds/hudson/cdt-maint + + + + + production + + + + maven-antrun-plugin + + + deploy + install + + run + + + + + + + + + + + + + + + + + + + + + diff --git a/releng/org.eclipse.cdt.sdk-feature/pom.xml b/releng/org.eclipse.cdt.sdk-feature/pom.xml index 8d8fb0696a3..ac901feebff 100644 --- a/releng/org.eclipse.cdt.sdk-feature/pom.xml +++ b/releng/org.eclipse.cdt.sdk-feature/pom.xml @@ -11,6 +11,7 @@ ../../pom.xml - org.eclipse.cdt.sdk-feature + org.eclipse.cdt.features + org.eclipse.cdt.sdk eclipse-feature diff --git a/upc/org.eclipse.cdt.bupc-feature/pom.xml b/upc/org.eclipse.cdt.bupc-feature/pom.xml index 8a069b6827d..314702433d6 100644 --- a/upc/org.eclipse.cdt.bupc-feature/pom.xml +++ b/upc/org.eclipse.cdt.bupc-feature/pom.xml @@ -12,6 +12,6 @@ 1.0.3-SNAPSHOT - org.eclipse.cdt.bupc-feature + org.eclipse.cdt.bupc eclipse-feature diff --git a/upc/org.eclipse.cdt.core.parser.upc.sdk.feature/pom.xml b/upc/org.eclipse.cdt.core.parser.upc.sdk.feature/pom.xml index a5db8467e60..69d6b7a1e4c 100644 --- a/upc/org.eclipse.cdt.core.parser.upc.sdk.feature/pom.xml +++ b/upc/org.eclipse.cdt.core.parser.upc.sdk.feature/pom.xml @@ -12,6 +12,6 @@ 5.1.0-SNAPSHOT - org.eclipse.cdt.core.parser.upc.sdk.feature + org.eclipse.cdt.core.parser.upc.sdk eclipse-feature diff --git a/upc/org.eclipse.cdt.core.parser.upc.source.feature/pom.xml b/upc/org.eclipse.cdt.core.parser.upc.source.feature/pom.xml index 424facea986..589c5e15a0c 100644 --- a/upc/org.eclipse.cdt.core.parser.upc.source.feature/pom.xml +++ b/upc/org.eclipse.cdt.core.parser.upc.source.feature/pom.xml @@ -11,7 +11,8 @@ ../../pom.xml + org.eclipse.cdt.features 5.1.0-SNAPSHOT - org.eclipse.cdt.core.parser.upc.source.feature + org.eclipse.cdt.core.parser.upc.source eclipse-feature diff --git a/util/org.eclipse.cdt.util-feature/pom.xml b/util/org.eclipse.cdt.util-feature/pom.xml index ee2668cccd5..35d10b8f8b2 100644 --- a/util/org.eclipse.cdt.util-feature/pom.xml +++ b/util/org.eclipse.cdt.util-feature/pom.xml @@ -12,6 +12,7 @@ 5.1.0-SNAPSHOT - org.eclipse.cdt.util-feature + org.eclipse.cdt.features + org.eclipse.cdt.util eclipse-feature diff --git a/windows/org.eclipse.cdt.msw-feature/pom.xml b/windows/org.eclipse.cdt.msw-feature/pom.xml index c9dc94c493e..969f4461b16 100644 --- a/windows/org.eclipse.cdt.msw-feature/pom.xml +++ b/windows/org.eclipse.cdt.msw-feature/pom.xml @@ -12,6 +12,6 @@ 1.0.0-SNAPSHOT - org.eclipse.cdt.msw-feature + org.eclipse.cdt.msw eclipse-feature diff --git a/xlc/org.eclipse.cdt.xlc.sdk-feature/pom.xml b/xlc/org.eclipse.cdt.xlc.sdk-feature/pom.xml index 89d8d8b564f..365fa594a01 100644 --- a/xlc/org.eclipse.cdt.xlc.sdk-feature/pom.xml +++ b/xlc/org.eclipse.cdt.xlc.sdk-feature/pom.xml @@ -12,6 +12,6 @@ 6.1.0-SNAPSHOT - org.eclipse.cdt.xlc.sdk-feature + org.eclipse.cdt.xlc.sdk eclipse-feature diff --git a/xlc/org.eclipse.cdt.xlc.source.feature/pom.xml b/xlc/org.eclipse.cdt.xlc.source.feature/pom.xml index 3fca6e7739b..6635b5a7e91 100644 --- a/xlc/org.eclipse.cdt.xlc.source.feature/pom.xml +++ b/xlc/org.eclipse.cdt.xlc.source.feature/pom.xml @@ -12,6 +12,7 @@ 6.1.0-SNAPSHOT - org.eclipse.cdt.xlc.source.feature + org.eclipse.cdt.features + org.eclipse.cdt.xlc.source eclipse-feature