From 90353a19c1da841b6fbedeab49b03382e5d935db Mon Sep 17 00:00:00 2001 From: Andrew Gvozdev Date: Mon, 21 Jan 2013 15:18:25 -0500 Subject: [PATCH] bug 398681: CDT does not understand some of xlC diagnostic messages --- .../xlc/tests/AllXlcErrorParserTests.java | 8 ++++ .../tests/TestCommandOptionNotRecognized.java | 39 ++++++++++++++++++ .../xlc/tests/TestInformationalMessage_2.java | 39 ++++++++++++++++++ .../xlc/tests/TestInformationalMessage_3.java | 38 ++++++++++++++++++ .../TestLinkerCommandOptionNotRecognized.java | 40 +++++++++++++++++++ .../xlc/tests/TestUnrecoverableError_2.java | 39 ++++++++++++++++++ .../xlc/tests/TestUnrecoverableError_3.java | 39 ++++++++++++++++++ .../plugin.properties | 9 +++++ .../plugin.xml | 4 ++ 9 files changed, 255 insertions(+) create mode 100644 xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestCommandOptionNotRecognized.java create mode 100644 xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestInformationalMessage_2.java create mode 100644 xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestInformationalMessage_3.java create mode 100644 xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestLinkerCommandOptionNotRecognized.java create mode 100644 xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestUnrecoverableError_2.java create mode 100644 xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestUnrecoverableError_3.java diff --git a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/AllXlcErrorParserTests.java b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/AllXlcErrorParserTests.java index 2b01874b439..4b82f75b2e7 100644 --- a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/AllXlcErrorParserTests.java +++ b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/AllXlcErrorParserTests.java @@ -22,6 +22,8 @@ public class AllXlcErrorParserTests { TestSuite suite = new TestSuite("Testsuite for xlc compiler error parser"); //$JUnit-BEGIN$ suite.addTestSuite(TestInformationalMessage_1.class); + suite.addTestSuite(TestInformationalMessage_2.class); + suite.addTestSuite(TestInformationalMessage_3.class); suite.addTestSuite(TestWarning_1.class); suite.addTestSuite(TestError_1.class); suite.addTestSuite(TestSevereError_1.class); @@ -30,15 +32,21 @@ public class AllXlcErrorParserTests { suite.addTestSuite(TestSevereError_4.class); suite.addTestSuite(TestSevereError_5.class); suite.addTestSuite(TestUnrecoverableError_1.class); + suite.addTestSuite(TestUnrecoverableError_2.class); + suite.addTestSuite(TestUnrecoverableError_3.class); suite.addTestSuite(TestCompatibility.class); suite.addTestSuite(TestRedefinition.class); suite.addTestSuite(TestRedeclaration.class); + suite.addTestSuite(TestCommandOptionNotRecognized.class); + + suite.addTestSuite(TestLinkerCommandOptionNotRecognized.class); suite.addTestSuite(TestLinkerUndefinedSymbol.class); suite.addTestSuite(TestLinkerDuplicateSymbol.class); suite.addTestSuite(TestLinkerSevereError.class); suite.addTestSuite(TestLinkerErrorWhileReading.class); suite.addTestSuite(TestLinkerInfo.class); + //$JUnit-END$ return suite; } diff --git a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestCommandOptionNotRecognized.java b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestCommandOptionNotRecognized.java new file mode 100644 index 00000000000..6a69a3930ae --- /dev/null +++ b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestCommandOptionNotRecognized.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright (c) 2013, 2013 Andrew Gvozdev and others. + * 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: + * Andrew Gvozdev - initial API and implementation + *******************************************************************************/ +package org.eclipse.cdt.errorparsers.xlc.tests; + +import junit.framework.TestCase; + +import org.eclipse.cdt.core.IMarkerGenerator; + +public class TestCommandOptionNotRecognized extends TestCase { + String err_msg; + /** + * This function tests parseLine function of the + * XlcErrorParser class. A warning message generated by + * xlc compiler about command options is given as + * input for testing. + */ + public void testparseLine() + { + XlcErrorParserTester aix = new XlcErrorParserTester(); + aix.parseLine(err_msg); + assertEquals("", aix.getFileName(0)); + assertEquals(0, aix.getLineNumber(0)); + assertEquals(IMarkerGenerator.SEVERITY_WARNING, aix.getSeverity(0)); + assertEquals("command option 9 is not recognized - passed to ld",aix.getMessage(0)); + } + public TestCommandOptionNotRecognized(String name) + { + super(name); + err_msg = "/usr/vacpp/bin/xlc: 1501-216 command option 9 is not recognized - passed to ld"; + } +} diff --git a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestInformationalMessage_2.java b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestInformationalMessage_2.java new file mode 100644 index 00000000000..f2096b2794a --- /dev/null +++ b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestInformationalMessage_2.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright (c) 2013, 2013 Andrew Gvozdev and others. + * 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: + * Andrew Gvozdev - initial API and implementation + *******************************************************************************/ +package org.eclipse.cdt.errorparsers.xlc.tests; + +import junit.framework.TestCase; + +import org.eclipse.cdt.core.IMarkerGenerator; + +public class TestInformationalMessage_2 extends TestCase { + String err_msg; + /** + * This function tests parseLine function of the + * XlcErrorParser class. A variant of informational message generated by + * xlc compiler with no file or line is given as + * input for testing. + */ + public void testparseLine() + { + XlcErrorParserTester aix = new XlcErrorParserTester(); + aix.parseLine(err_msg); + assertEquals("", aix.getFileName(0)); + assertEquals(0, aix.getLineNumber(0)); + assertEquals(IMarkerGenerator.SEVERITY_INFO, aix.getSeverity(0)); + assertEquals("clazz::fun(): Additional optimization may be attained by recompiling and specifying MAXMEM option with a value greater than 8192.",aix.getMessage(0)); + } + public TestInformationalMessage_2( String name) + { + super(name); + err_msg = " 1500-030: (I) INFORMATION: clazz::fun(): Additional optimization may be attained by recompiling and specifying MAXMEM option with a value greater than 8192."; + } +} diff --git a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestInformationalMessage_3.java b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestInformationalMessage_3.java new file mode 100644 index 00000000000..c68072051e5 --- /dev/null +++ b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestInformationalMessage_3.java @@ -0,0 +1,38 @@ +/******************************************************************************* + * Copyright (c) 2013, 2013 Andrew Gvozdev and others. + * 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: + * Andrew Gvozdev - initial API and implementation + *******************************************************************************/ +package org.eclipse.cdt.errorparsers.xlc.tests; + +import junit.framework.TestCase; + +import org.eclipse.cdt.core.IMarkerGenerator; + +public class TestInformationalMessage_3 extends TestCase { + String err_msg; + /** + * This function tests parseLine function of the + * XlcErrorParser class. A variant of informational message generated by + * xlc compiler is given as input for testing. + */ + public void testparseLine() + { + XlcErrorParserTester aix = new XlcErrorParserTester(); + aix.parseLine(err_msg); + assertEquals("", aix.getFileName(0)); + assertEquals(0, aix.getLineNumber(0)); + assertEquals(IMarkerGenerator.SEVERITY_INFO, aix.getSeverity(0)); + assertEquals("Global variable \"__td __td__Q2_3std13runtime_error\" is not used.",aix.getMessage(0)); + } + public TestInformationalMessage_3( String name) + { + super(name); + err_msg = "1540-5336 (I) Global variable \"__td __td__Q2_3std13runtime_error\" is not used."; + } +} diff --git a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestLinkerCommandOptionNotRecognized.java b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestLinkerCommandOptionNotRecognized.java new file mode 100644 index 00000000000..ce83c6d716f --- /dev/null +++ b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestLinkerCommandOptionNotRecognized.java @@ -0,0 +1,40 @@ +/******************************************************************************* + * Copyright (c) 2006, 2009 IBM Corporation and others. + * 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: + * IBM Corporation - initial API and implementation + *******************************************************************************/ + +package org.eclipse.cdt.errorparsers.xlc.tests; + +import junit.framework.TestCase; + +import org.eclipse.cdt.core.IMarkerGenerator; + +public class TestLinkerCommandOptionNotRecognized extends TestCase { + String err_msg; + /** + * This function tests parseLine function of the + * XlcErrorParser class. A warning message generated by + * xlc linker about command options is given as + * input for testing. + */ + public void testparseLine() + { + XlcErrorParserTester aix = new XlcErrorParserTester(); + aix.parseLine(err_msg); + assertEquals("", aix.getFileName(0)); + assertEquals(0, aix.getLineNumber(0)); + assertEquals(IMarkerGenerator.SEVERITY_WARNING, aix.getSeverity(0)); + assertEquals("The -9 flag is not recognized.",aix.getMessage(0)); + } + public TestLinkerCommandOptionNotRecognized(String name) + { + super(name); + err_msg = "ld: 0706-012 The -9 flag is not recognized."; + } +} diff --git a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestUnrecoverableError_2.java b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestUnrecoverableError_2.java new file mode 100644 index 00000000000..78521af2ab8 --- /dev/null +++ b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestUnrecoverableError_2.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright (c) 2013, 2013 Andrew Gvozdev and others. + * 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: + * Andrew Gvozdev - initial API and implementation + *******************************************************************************/ +package org.eclipse.cdt.errorparsers.xlc.tests; + +import junit.framework.TestCase; + +import org.eclipse.cdt.core.IMarkerGenerator; + +public class TestUnrecoverableError_2 extends TestCase { + String err_msg; + /** + * This function tests parseLine function of the + * XlcErrorParser class. A variant of error message generated by + * xlc compiler with unrecoverable severity (U) is given as + * input for testing. + */ + public void testparseLine() + { + XlcErrorParserTester aix = new XlcErrorParserTester(); + aix.parseLine(err_msg); + assertEquals("", aix.getFileName(0)); + assertEquals(0, aix.getLineNumber(0)); + assertEquals(IMarkerGenerator.SEVERITY_ERROR_RESOURCE, aix.getSeverity(0)); + assertEquals("An error occurred during code generation. The code generation return code was 1.",aix.getMessage(0)); + } + public TestUnrecoverableError_2( String name) + { + super(name); + err_msg = "1586-346 (U) An error occurred during code generation. The code generation return code was 1."; + } +} diff --git a/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestUnrecoverableError_3.java b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestUnrecoverableError_3.java new file mode 100644 index 00000000000..a26d941a2ec --- /dev/null +++ b/xlc/org.eclipse.cdt.errorparsers.xlc.tests/src/org/eclipse/cdt/errorparsers/xlc/tests/TestUnrecoverableError_3.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright (c) 2013, 2013 Andrew Gvozdev and others. + * 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: + * Andrew Gvozdev - initial API and implementation + *******************************************************************************/ +package org.eclipse.cdt.errorparsers.xlc.tests; + +import junit.framework.TestCase; + +import org.eclipse.cdt.core.IMarkerGenerator; + +public class TestUnrecoverableError_3 extends TestCase { + String err_msg; + /** + * This function tests parseLine function of the + * XlcErrorParser class. A variant of error message generated by + * xlc compiler with unrecoverable severity (U) is given as + * input for testing. + */ + public void testparseLine() + { + XlcErrorParserTester aix = new XlcErrorParserTester(); + aix.parseLine(err_msg); + assertEquals("", aix.getFileName(0)); + assertEquals(0, aix.getLineNumber(0)); + assertEquals(IMarkerGenerator.SEVERITY_ERROR_RESOURCE, aix.getSeverity(0)); + assertEquals("INTERNAL COMPILER ERROR while compiling ----. Compilation ended. Contact your Service Representative and provide the following information: Internal abort. For more information visit: http://www.ibm.com/support/docview.wss?uid=swg21110810",aix.getMessage(0)); + } + public TestUnrecoverableError_3( String name) + { + super(name); + err_msg = " 1500-004: (U) INTERNAL COMPILER ERROR while compiling ----. Compilation ended. Contact your Service Representative and provide the following information: Internal abort. For more information visit: http://www.ibm.com/support/docview.wss?uid=swg21110810"; + } +} diff --git a/xlc/org.eclipse.cdt.errorparsers.xlc/plugin.properties b/xlc/org.eclipse.cdt.errorparsers.xlc/plugin.properties index 405a9e7419a..cef2c77ad87 100644 --- a/xlc/org.eclipse.cdt.errorparsers.xlc/plugin.properties +++ b/xlc/org.eclipse.cdt.errorparsers.xlc/plugin.properties @@ -35,10 +35,19 @@ CDTXLCErrorParser.pattern.redeclaration.crossreference=Redeclaration of $4 diffe CDTXLCErrorParser.pattern.error="?([^"]*)"?, line ([0-9]+)\\.[0-9]+:( [0-9]*-[0-9]*)? \\([USE]\\)\\s*(.*) CDTXLCErrorParser.pattern.warning="?([^"]*)"?, line ([0-9]+)\\.[0-9]+:( [0-9]*-[0-9]*)? \\(W\\)\\s*(.*) CDTXLCErrorParser.pattern.info="?([^"]*)"?, line ([0-9]+)\\.[0-9]+:( [0-9]*-[0-9]*)? \\(I\\)\\s*(.*) +# 1586-346 (U) An error occurred during code generation. The code generation return code was 1. +CDTXLCErrorParser.pattern.error2=\\s*([0-9]*-[0-9]*:?)? \\([USE]\\)\\s*(.*) +# /usr/vacpp/bin/xlc: 1501-216 command option 9 is not recognized - passed to ld +CDTXLCErrorParser.pattern.warning2=/[/\\w]+: [0-9]+-[0-9]+\\s*(.*) +# 1500-030: (I) INFORMATION: clazz::fun(): Additional optimization may be attained by recompiling and specifying MAXMEM option with a value greater than 8192. +# 1540-5336 (I) Global variable "__td __td__Q2_3std13runtime_error" is not used. +CDTXLCErrorParser.pattern.info2=\\s*([0-9]*-[0-9]*:?)? \\(I\\)( INFORMATION:)?\\s*(.*) # ld: 0711-224 WARNING: Duplicate symbol: symboldupe # WARNING, ERROR, SEVERE ERROR etc. CDTXLCErrorParser.pattern.ld.error=ld: ([0-9]+-[0-9]+).*ERROR:\\s*(.*) CDTXLCErrorParser.pattern.ld.warning=ld: ([0-9]+-[0-9]+)\\s*WARNING:\\s*(.*) +# ld: 0706-012 The -9 flag is not recognized. +CDTXLCErrorParser.pattern.ld.warning2=ld: 0706-012\\s*(.*) # ld: 0711-987 Error occurred while reading file CDTXLCErrorParser.pattern.ld.error2=ld: ([0-9]+-[0-9]+)\\s*(Error .*) # ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information. diff --git a/xlc/org.eclipse.cdt.errorparsers.xlc/plugin.xml b/xlc/org.eclipse.cdt.errorparsers.xlc/plugin.xml index 7fde01587b6..dff6bff116d 100644 --- a/xlc/org.eclipse.cdt.errorparsers.xlc/plugin.xml +++ b/xlc/org.eclipse.cdt.errorparsers.xlc/plugin.xml @@ -11,11 +11,15 @@ + + + +