Merge with ba6179dfe20e3a949de0612e01bd71d0e6918b78
authorl12wang
Thu, 08 Oct 2009 18:13:59 -0500
changeset 100 6e8bead0f126
parent 99 83ae0d82da3b (current diff)
parent 98 ba6179dfe20e (diff)
child 101 133ef3ae697b
Merge with ba6179dfe20e3a949de0612e01bd71d0e6918b78
--- a/cdt/cdt_6_0_x/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/GCCErrorParser.java	Thu Oct 08 17:43:28 2009 -0500
+++ b/cdt/cdt_6_0_x/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/GCCErrorParser.java	Thu Oct 08 18:13:59 2009 -0500
@@ -36,7 +36,7 @@
 		new ErrorPattern(Messages.GCCErrorParser_skip_note),
 		new ErrorPattern(Messages.GCCErrorParser_sikp_instantiatedFromHere),
 		// The following are not...
-		new ErrorPattern(Messages.GCCErrorParser_Warnings, 1, 2, 6, 0, 0) {
+		new ErrorPattern(Messages.GCCErrorParser_Warnings, 1, 2, 5, 0, 0) {
 			@Override
 			public String getVarName(Matcher matcher) {
 				String desc = getDesc(matcher);
--- a/cdt/cdt_6_0_x/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/messages.properties	Thu Oct 08 17:43:28 2009 -0500
+++ b/cdt/cdt_6_0_x/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/errorparsers/messages.properties	Thu Oct 08 18:13:59 2009 -0500
@@ -16,7 +16,8 @@
 GCCErrorParser_skip_forEachFunction=for each function it appears in.\\)
 GCCErrorParser_skip_note=: note:
 GCCErrorParser_sikp_instantiatedFromHere=instantiated from 
-GCCErrorParser_Warnings=(.*?):([0-9]+):([0-9]+:)?( (.*[Ww]arning:|WARNING:|[Ee]rror:))? (.*)
+#GCCErrorParser_Warnings=(.*?):([0-9]+):([0-9]+:)?( (.*[Ww]arning:|WARNING:|[Ee]rror:))? (.*)
+GCCErrorParser_Warnings=(.*?):([0-9]+):([0-9]+:)?(.*?[([Ww]arning)(WARNING)([Ee]rror)]:)? (.*)
 GLDErrorParser_error_text=(.*)\\(\\.text\\+.*\\): (.*)
 GLDErrorParser_warning_general=ld(\\.exe)?: [Ww]arning:? (.*)
 GLDErrorParser_error_general=ld(\\.exe)?: (.*)
--- a/cdt/cdt_6_0_x/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/ElfBinaryObject.java	Thu Oct 08 17:43:28 2009 -0500
+++ b/cdt/cdt_6_0_x/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/parser/ElfBinaryObject.java	Thu Oct 08 18:13:59 2009 -0500
@@ -13,17 +13,21 @@
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
+import org.eclipse.cdt.core.IAddress;
 import org.eclipse.cdt.core.IAddressFactory;
 import org.eclipse.cdt.core.IBinaryParser;
 import org.eclipse.cdt.core.ISymbolReader;
 import org.eclipse.cdt.core.IBinaryParser.IBinaryFile;
 import org.eclipse.cdt.core.IBinaryParser.ISymbol;
 import org.eclipse.cdt.utils.AR;
+import org.eclipse.cdt.utils.Addr32;
 import org.eclipse.cdt.utils.Addr32Factory;
+import org.eclipse.cdt.utils.Addr64;
 import org.eclipse.cdt.utils.BinaryObjectAdapter;
 import org.eclipse.cdt.utils.Symbol;
 import org.eclipse.cdt.utils.elf.Elf;
@@ -177,12 +181,26 @@
 
 		symbols = list.toArray(NO_SYMBOLS);
 		Arrays.sort(symbols);
+		
 		list.clear();
 	}
 
 	protected void addSymbols(Elf.Symbol[] array, int type, List<Symbol> list) {
+		boolean duplicateAddressFound;
 		for (int i = 0; i < array.length; i++) {
-			list.add(new Symbol(this, array[i].toString(), type, array[i].st_value, array[i].st_size));
+			// Multiple function symbol entries for the same address are generated
+			// do not add duplicate symbols with 0 size to the list
+			duplicateAddressFound = false;
+			if (type == ISymbol.FUNCTION && array[i].st_size == 0){
+				for (Symbol s : list) {
+					if (s.getAddress().equals(array[i].st_value)){
+						duplicateAddressFound = true;
+						break;
+					}
+				}
+			}
+			if (!duplicateAddressFound)	
+				list.add(new Symbol(this, array[i].toString(), type, array[i].st_value, array[i].st_size));
 		}
 	}