mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 06:02:11 +02:00
Bug 495661 - Period is a valid symbol in a section name
When using -ffunction-section, each function is placed in it's own
section name. For example the main() function would be placed in
.text.main, so the pattern looking for undefined references needs to
allow the extra dot there.
Since C++ will use other symbols than what's included in \w, lets allow
everything except a + sign and whitespace.
Change-Id: I66d9ee7d8cbc0a405e60d7cdeb43c38b30107245
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
(cherry picked from commit 36de92cc77
)
This commit is contained in:
parent
66d637e699
commit
f4951d8086
4 changed files with 47 additions and 13 deletions
|
@ -38,12 +38,13 @@ public class GLDErrorParserTests extends GenericErrorParserTests {
|
||||||
new String[] { "make -k all", "gcc -o hallo.o main.c libfoo.a",
|
new String[] { "make -k all", "gcc -o hallo.o main.c libfoo.a",
|
||||||
"main.c(.text+0x14): undefined reference to `foo()'",
|
"main.c(.text+0x14): undefined reference to `foo()'",
|
||||||
"main.o(.rodata+0x14): undefined reference to `something'",
|
"main.o(.rodata+0x14): undefined reference to `something'",
|
||||||
|
"(.text.myfunc+0x42): undefined reference to `bar'",
|
||||||
"make: Target `all' not remade because of errors.", },
|
"make: Target `all' not remade because of errors.", },
|
||||||
2, // errors
|
3, // errors
|
||||||
0, // warnings
|
0, // warnings
|
||||||
0, // Infos
|
0, // Infos
|
||||||
new String[] { "main.c", "main.o" },
|
new String[] { "main.c", "main.o", "project" }, new String[] { "undefined reference to `foo()'",
|
||||||
new String[] { "undefined reference to `foo()'", "undefined reference to `something'" },
|
"undefined reference to `something'", "undefined reference to `bar'" },
|
||||||
new String[] { GLD_ERROR_PARSER_ID });
|
new String[] { GLD_ERROR_PARSER_ID });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,12 +54,13 @@ public class GLDErrorParserTests extends GenericErrorParserTests {
|
||||||
new String[] { "make -k all", "gcc -o hallo.o main.c libfoo.a",
|
new String[] { "make -k all", "gcc -o hallo.o main.c libfoo.a",
|
||||||
"main.c:(.text+0x14): undefined reference to `foo()'",
|
"main.c:(.text+0x14): undefined reference to `foo()'",
|
||||||
"main.o:(.rodata+0x14): undefined reference to `something'",
|
"main.o:(.rodata+0x14): undefined reference to `something'",
|
||||||
|
"(.text.myfunc+0x42): undefined reference to `bar'",
|
||||||
"make: Target `all' not remade because of errors.", },
|
"make: Target `all' not remade because of errors.", },
|
||||||
2, // errors
|
3, // errors
|
||||||
0, // warnings
|
0, // warnings
|
||||||
0, // Infos
|
0, // Infos
|
||||||
new String[] { "main.c", "main.o" },
|
new String[] { "main.c", "main.o", "project" }, new String[] { "undefined reference to `foo()'",
|
||||||
new String[] { "undefined reference to `foo()'", "undefined reference to `something'" },
|
"undefined reference to `something'", "undefined reference to `bar'" },
|
||||||
new String[] { GLD_ERROR_PARSER_ID });
|
new String[] { GLD_ERROR_PARSER_ID });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,4 +106,32 @@ public class GLDErrorParserTests extends GenericErrorParserTests {
|
||||||
"cannot find -ljpeg", },
|
"cannot find -ljpeg", },
|
||||||
new String[] { GLD_ERROR_PARSER_ID });
|
new String[] { GLD_ERROR_PARSER_ID });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testLinkerMessages_bug495661() throws IOException {
|
||||||
|
runParserTest(
|
||||||
|
// new style: colons before sections
|
||||||
|
new String[] { "make all ",
|
||||||
|
// @formatter:off
|
||||||
|
"Building file: ../src/a.cpp",
|
||||||
|
"Invoking: GCC C++ Compiler",
|
||||||
|
"g++ -std=c++0x -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF\"src/a.d\" -MT\"src/a.o\" -o \"src/a.o\" \"../src/a.cpp\"",
|
||||||
|
"Finished building: ../src/a.cpp",
|
||||||
|
" ",
|
||||||
|
"Building target: parser",
|
||||||
|
"Invoking: GCC C++ Linker",
|
||||||
|
"g++ -o \"a\" ./src/a.o ",
|
||||||
|
"/usr/lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: ./src/a.o: in function `TLS wrapper function for A::max_compatdb_time':",
|
||||||
|
"a.cpp:(.text._ZTWN1A17max_compatdb_timeE[_ZTWN1A17max_compatdb_timeE]+0x21): undefined reference to `A::max_compatdb_time'",
|
||||||
|
"collect2: error: ld returned 1 exit status",
|
||||||
|
"make: *** [makefile:47: parser] Error 1",
|
||||||
|
"\"make all\" terminated with exit code 2. Build might be incomplete.", },
|
||||||
|
// @formatter:on
|
||||||
|
2, // errors
|
||||||
|
0, // warnings
|
||||||
|
0, // Infos
|
||||||
|
new String[] { "a.cpp", "project" },
|
||||||
|
new String[] { "./src/a.o: in function `TLS wrapper function for A::max_compatdb_time':",
|
||||||
|
"undefined reference to `A::max_compatdb_time'" },
|
||||||
|
new String[] { GLD_ERROR_PARSER_ID });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -140,9 +140,13 @@ public abstract class GenericErrorParserTests extends TestCase {
|
||||||
if (expectedFileNames != null) {
|
if (expectedFileNames != null) {
|
||||||
assertEquals(expectedFileNames.length, markerGenerator.uniqFiles.size());
|
assertEquals(expectedFileNames.length, markerGenerator.uniqFiles.size());
|
||||||
for (int i = 0; i < expectedFileNames.length; i++) {
|
for (int i = 0; i < expectedFileNames.length; i++) {
|
||||||
// Keep in mind that uniqFiles get alphabetically sorted
|
IResource resource = markerGenerator.uniqFiles.get(i);
|
||||||
IPath path = ((IFile) markerGenerator.uniqFiles.get(i)).getLocation();
|
// Markers for errors without source file has resource of type IProject
|
||||||
assertEquals(expectedFileNames[i], path.lastSegment());
|
if (!(resource instanceof IProject)) {
|
||||||
|
assertTrue(resource instanceof IFile);
|
||||||
|
// Keep in mind that uniqFiles get alphabetically sorted
|
||||||
|
assertEquals(expectedFileNames[i], resource.getLocation().lastSegment());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ Manifest-Version: 1.0
|
||||||
Bundle-ManifestVersion: 2
|
Bundle-ManifestVersion: 2
|
||||||
Bundle-Name: %pluginName
|
Bundle-Name: %pluginName
|
||||||
Bundle-SymbolicName: org.eclipse.cdt.core; singleton:=true
|
Bundle-SymbolicName: org.eclipse.cdt.core; singleton:=true
|
||||||
Bundle-Version: 6.11.0.qualifier
|
Bundle-Version: 6.11.1.qualifier
|
||||||
Bundle-Activator: org.eclipse.cdt.core.CCorePlugin
|
Bundle-Activator: org.eclipse.cdt.core.CCorePlugin
|
||||||
Bundle-Vendor: %providerName
|
Bundle-Vendor: %providerName
|
||||||
Bundle-Localization: plugin
|
Bundle-Localization: plugin
|
||||||
|
|
|
@ -68,10 +68,10 @@ CDTGNUCErrorParser.regex.GenericWarning=(.*?):(\\d+):(\\d+:)?\\s*(([Ww]arning)|(
|
||||||
CDTGNUCErrorParser.regex.OtherError=(.*?):(\\d+):(\\d+:)? (.*)
|
CDTGNUCErrorParser.regex.OtherError=(.*?):(\\d+):(\\d+:)? (.*)
|
||||||
|
|
||||||
CDTGNULinkerErrorParser.name=GNU Linker Error Parser
|
CDTGNULinkerErrorParser.name=GNU Linker Error Parser
|
||||||
CDTGNULinkerErrorParser.regex.InFunction=(.*?):?(\\(\\.\\w+\\+.*\\))?:\\s*(In function [`'"](.*)['"]:)
|
CDTGNULinkerErrorParser.regex.InFunction=(.*?):?(\\(\\.[^\\s+]+\\+.*\\))?:\\s*(In function [`'"](.*)['"]:)
|
||||||
CDTGNULinkerErrorParser.regex.WarningDangerousFunction=(.*?):(\\d+):(\\d+:)? ([Ww]arning:)?\\s*(the use of [`'"](.*)['"] is dangerous, better use [`'"](.*)['"].*)
|
CDTGNULinkerErrorParser.regex.WarningDangerousFunction=(.*?):(\\d+):(\\d+:)? ([Ww]arning:)?\\s*(the use of [`'"](.*)['"] is dangerous, better use [`'"](.*)['"].*)
|
||||||
CDTGNULinkerErrorParser.regex.TextWarning=(.*?):?\\(\\.\\w+\\+.*\\): [Ww]arning:? (.*)
|
CDTGNULinkerErrorParser.regex.TextWarning=(.*?):?\\(\\.[^\\s+]+\\+.*\\): [Ww]arning:? (.*)
|
||||||
CDTGNULinkerErrorParser.regex.TextError=(.*?):?\\(\\.\\w+\\+.*\\): (.*)
|
CDTGNULinkerErrorParser.regex.TextError=(.*?):?\\(\\.[^\\s+]+\\+.*\\): (.*)
|
||||||
CDTGNULinkerErrorParser.regex.ldWarning=(.*[/\\\\])?ld(\\.exe)?: [Ww]arning:? (.*)
|
CDTGNULinkerErrorParser.regex.ldWarning=(.*[/\\\\])?ld(\\.exe)?: [Ww]arning:? (.*)
|
||||||
CDTGNULinkerErrorParser.regex.ldError=(.*[/\\\\])?ld(\\.exe)?: (.*)
|
CDTGNULinkerErrorParser.regex.ldError=(.*[/\\\\])?ld(\\.exe)?: (.*)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue