Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Can't get the error parsers to work
Can't get the error parsers to work [message #660162] Thu, 17 March 2011 07:50 Go to next message
Alex  is currently offline Alex Friend
Messages: 7
Registered: March 2011
Junior Member
I'm using a batch file to build my project (I'm using the C51 compiler from Keil). The output is correctly displayed in the Console view, but none of the error parsers seem to do absolutely anything.

I've tried the built-in parsers (although I knew I'd probably have to write my own), I've written my own error parser (which I've then checked to see if it works), I've even tried adding new rules to the existing parsers, without any luck. Not even this regex seems to work:

(.*)

I've also tried using the RegEx Error Parser from iSystem; I've seen others who managed to successfully get it to work, but still nothing happened.

Has anyone had any luck in getting the error parser to correctly interpret the console output? I'm using the Helios Service Release 2 of the Eclipse CDT.
Re: Can't get the error parsers to work [message #660363 is a reply to message #660162] Fri, 18 March 2011 06:44 Go to previous messageGo to next message
Dirk Wibben is currently offline Dirk WibbenFriend
Messages: 50
Registered: February 2010
Member
Could you give examples of those error/warning outputs of your compiler?
Is there maybe a CR/LF in those error messages?
I have had the same issue, but in my error outputs there were indeed CR/LFs 'for better formatting'. Luckily there is an output formatting option in the compiler settings to NOT use CR/LF. After using that option, the error messages were parsed as expected.


Cheers
Dirk


Best regards
Dirk
Re: Can't get the error parsers to work [message #660368 is a reply to message #660363] Fri, 18 March 2011 07:12 Go to previous messageGo to next message
Alex  is currently offline Alex Friend
Messages: 7
Registered: March 2011
Junior Member
Well, the compiler doesn't have a lot of options, so that would be difficult. The output does indeed use CR/LF as a newline. Here's a sample:

Build target 'Target'
compiling Main_App.c...
compiling Mgr.c...
APP\MGR.C(395): warning C280: 'maxLen': unreferenced local variable
APP\MGR.C(973): warning C280: 'destBuff': unreferenced local variable

Each line ends in CR/LF. How should the output look like to be parsed by the error parser? Or how can I change the regex expressions used to actually take the newline into account. I would expect the regex I used to at least return something (anything). The annoying thing is that I see the output in the console, it's just ignored by the parser.

[Updated on: Fri, 18 March 2011 07:14]

Report message to a moderator

Re: Can't get the error parsers to work [message #660375 is a reply to message #660368] Fri, 18 March 2011 08:05 Go to previous messageGo to next message
Dirk Wibben is currently offline Dirk WibbenFriend
Messages: 50
Registered: February 2010
Member
No you got me slightly wrong.
My problem were CR/LF IN THE LINE of the error message. In other words: ONE error message spanned over TWO lines of output.

Here is my configuration, which works:

- Eclipse Helios with CDT 7.0.2
- Window | Preferences | C/C++ | Build | 'CDT GNU C/C++ Error Parser' as the ONLY error parser checked 'ON'
- Project | Properties | C/C++ Build | <Select a Configuration> | Settings | Tab 'Error Parsers' | 'CDT GNU C/C++ Error Parser' as the ONLY error parser checked 'ON'

Here is an example of my compiler output with an intentionally provoked warning:
compiling .\HAL\System\MemoryControl\MemoryHandler.c

     (void)Fulash_GetBlockNumber(MEMORYSTART_ROM_VT, &kBlockNumber);
           ^
"D:\projects\FSD21\OU_E_BO_K0R_DCOS\HAL\System\MemoryControl\MemoryHandler.c",579  Warning[Pe223]: function "Fulash_GetBlockNumber" declared implicitly

My added 'Error Parser Option' to the 'checked' Parser, which captures the above warning, looks like this:

"(.*)",([0-9]+) *[Ww]arning.*: (.*)

with
Severity = Warning
File = $1
Line = $2
Description = $3

Hope that helps.
Dirk


Best regards
Dirk
Re: Can't get the error parsers to work [message #660387 is a reply to message #660375] Fri, 18 March 2011 09:15 Go to previous messageGo to next message
Alex  is currently offline Alex Friend
Messages: 7
Registered: March 2011
Junior Member
Thank you. I tried that, but the same thing happens.
Re: Can't get the error parsers to work [message #660395 is a reply to message #660387] Fri, 18 March 2011 10:05 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
Do you use an external tool launch configuration to build your project or did you replace the default build command in your project? Error parsers do not work for external tools.

Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Can't get the error parsers to work [message #660487 is a reply to message #660395] Fri, 18 March 2011 15:47 Go to previous messageGo to next message
Alex  is currently offline Alex Friend
Messages: 7
Registered: March 2011
Junior Member
Thanks for the answer!

Yes, I am using the C51 compiler from Keil, which I run via a batch file. I wasn't aware that error parsers don't work when using an external build tool. Is there any way around this limitation?
Re: Can't get the error parsers to work [message #660594 is a reply to message #660487] Sat, 19 March 2011 18:12 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
Alex wrote on Fri, 18 March 2011 16:47
Thanks for the answer!

Yes, I am using the C51 compiler from Keil, which I run via a batch file. I wasn't aware that error parsers don't work when using an external build tool. Is there any way around this limitation?

Change the default build command in your project.
Project Properties->C/C++ Build
Uncheck "default build command" (it is make) and insert "mybatch.bat". You should also modify the default make targets for build all (in the next tab).


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Can't get the error parsers to work [message #660683 is a reply to message #660594] Mon, 21 March 2011 07:06 Go to previous message
Alex  is currently offline Alex Friend
Messages: 7
Registered: March 2011
Junior Member
Thank you very much, Axel, that did the trick!
Previous Topic:ERROR WITH RUN IN C
Next Topic:Problems with Linked Resources
Goto Forum:
  


Current Time: Thu Apr 25 17:53:52 GMT 2024

Powered by FUDForum. Page generated in 0.05947 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top