Tuning Error Parsers
Error Parsers scan build output line by line looking for errors and warnings (also for certain informational messages). They generate Problem Markers 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 , Warning and Infocategories.
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:
- In the C/C++ Projects view, right-click the project, and select Properties.
- Expand C/C++ Build.
- Select Settings.
- Click the Error Parsers tab.
- In the Error parsers list, select error parsers.
- Click OK.
Note that the order of error parsers is significant. Normally an error parser will consume the line where it spotted an error/warning and the others down the line won't get a chance to parse it.
CDT provides one special kind of error parser, CDT pushd/popd CWD Locator. This parser does not create problem markers but it is looking for output of pushd and popd 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.
Most of the error parsers are configurable via regular expression patterns and a user can:
- Adjust a pattern to detect a problem more accurately,
- Disable useless or proliferating problems (Note that it can have positive effect on performance of the console),
- Create own error parser for a custom tool. Hint: To run a custom tool you can use Make Targets View.
To customize error parsers do following:
- Select Window > Preferences .
- Expand C/C++.
- Select Error Parsers tab.
- Select error parser or Add a new one.
- Follow Error Parser Options to define your custom patterns