| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
| <html lang="en"> |
| |
| <head> |
| <meta http-equiv="Content-Language" content="en-us"> |
| <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> |
| <meta name="ProgId" content="FrontPage.Editor.Document"> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <title>Tuning Error Parsers</title> |
| <link rel="stylesheet" type="text/css" href="../help.css"> |
| </head> |
| |
| <body> |
| |
| <div role="main"><h1>Tuning Error Parsers</h1> |
| |
| <p>Error Parsers scan build output line by line looking for errors and warnings |
| (also for certain informational messages). They generate <strong>Problem Markers</strong> |
| which visually indicate those problems to a user. The problems are highlighted on the Console, |
| populate the Problems view and shown in the editor. Problem markers are organized |
| into Error <img src="../images/icon_error.gif" alt="Error">, |
| Warning <img src="../images/icon_warning.gif" alt="Warning"> |
| and Info<img src="../images/icon_info.gif" alt="Info">categories. |
| </p> |
| |
| <p>There are several predefined Error Parsers where each one can handle output of a specific tool. |
| Normally a toolchain defines a set of Error Parsers to deal with output of each tool. It is possible |
| to redefine that set on a per-project basis in project properties: |
| </p> |
| <p> |
| <ol> |
| <li>In the C/C++ Projects view, right-click the project, and select <strong>Properties</strong>.</li> |
| <li>Expand <strong>C/C++ Build</strong>.</li> |
| <li>Select <strong>Settings</strong>.</li> |
| <li>Click the <strong>Error Parsers</strong> tab.</li> |
| <li>In the <strong>Error parsers</strong> list, select error parsers.</li> |
| <li>Click <strong>OK</strong>.</li> |
| </ol> |
| </p> |
| <p>Note that the order of error parsers is significant. Normally an error parser will <em>consume</em> |
| the line where it spotted an error/warning and the others down the line won't get a chance to parse it. |
| </p> |
| |
| <p>CDT provides one special kind of error parser, <strong>CDT pushd/popd CWD Locator</strong>. |
| This parser does not create problem markers but it is looking for output of <strong>pushd</strong> |
| and <strong>popd</strong> commands which are commonly used in makefiles to print the Current Working Directory (CWD). |
| CDT can use this information to associate the file names appearing in the output relative to the CWD. |
| Note that that kind of parser needs to be the first to be able to provide the CWD to the other parsers. |
| </p> |
| |
| <p>Most of the error parsers are configurable via regular expression patterns and a user can: |
| </p> |
| <p> |
| <ul> |
| <li>Adjust a pattern to detect a problem more accurately,</li> |
| <li>Disable useless or proliferating problems (Note that it can have positive effect on performance of the console),</li> |
| <li>Create own error parser for a custom tool. Hint: To run a custom tool you can use <strong>Make Targets View</strong>.</li> |
| </ul> |
| </p> |
| |
| <p>To customize error parsers do following: |
| </p> |
| <p> |
| <ol> |
| <li>Select <strong>Window > Preferences </strong>. </li> |
| <li>Expand <strong>C/C++</strong>.</li> |
| <li>Select <strong>Error Parsers</strong> tab.</li> |
| <li>Select error parser or <strong>Add</strong> a new one.</li> |
| <li>Follow <a href="../reference/cdt_u_pref_build_error_parsers.htm">Error Parser Options</a> to define your custom patterns</li> |
| </ol> |
| </p> |
| |
| <p><img src="../images/ngconcepts.gif" ALT="Related concepts" width="143" height="21"> |
| <br><a href="../concepts/cdt_c_projects.htm">CDT Projects</a> |
| <br><a href="../concepts/cdt_c_proj_file_views.htm">Project file views</a> |
| </p> |
| |
| <p><img src="../images/ngtasks.gif" ALT="Related tasks" width="143" height="21"> |
| <br><a href="cdt_o_builderrors.htm">Tracking down compilation errors</a> |
| <br><a href="../tasks/cdt_t_proj_error_parser.htm">Tuning Error Parsers</a> |
| </p> |
| |
| <p><img src="../images/ngref.gif" ALT="Related reference" width="143" height="21"> |
| <br><a href="../reference/cdt_u_console_view.htm">Console View</a> |
| <br><a href="../reference/cdt_u_problems_view.htm">Problems View</a> |
| <br><a href="../reference/cdt_u_make_targets_view.htm">Make Targets View</a> |
| <br><a href="../reference/cdt_u_prop_build_settings_errparser.htm">Error Parsers tab</a> |
| <br><a href="../reference/cdt_u_pref_build_error_parsers.htm">Error Parser Options</a> |
| </p> |
| |
| <img src="../images/ng00_04a.gif" ALT="QNX Copyright Statement" > |
| |
| </div></body> |
| |
| </html> |