views:

623

answers:

4

I'm using an uncommon C compiler with Eclipse CDT. I have a make file setup which is nice, but I'd like IDE integration with the error / warning output of my compiler.

Does anybody know what steps I can take to write a plugin for parsing / supporting my compilers output? I think it should be easy but there is a barrier of entry of figuring out where to start. Would be nice if Eclipse would let me do New -> Compiler Error Parser Plugin, or something like that.

Thanks

+3  A: 

It's not quite that simple...

First of all make sure you have the Eclipse PDE (Plug-in Development Environment) and CDT SDK installed. If not then you'll need to tell Eclipse to download them (Help -> Install New Software).

Then, create a new Plug-In project. In its Extensions tab, add a new extension against point org.eclipse.cdt.core.ErrorParser. You will then have to write some java code to actually implement it. Fortunately the PDE makes the meta-work relatively straightforward; you put the name of your class in the appropriate box and click on the "class*" hyperlink and it will offer to create a skeleton class for you.

I suggest you grab the source code to the CDT and have a look at GCCErrorParser.java as an illustration of the sorts of things yours will have to do.

Finally, when you're ready to test it, set up a debug configuration of type Eclipse Application. (This will spawn a second instance of Eclipse; it has to use a different workbench.) Go into the properties of your C project, Settings panel, Error Parsers tab and switch on your shiny new error parser.

crazyscot
+2  A: 

In CDT 7 there is going to be a regular expression error parser included which should make this sort of thing much simpler. There are some details on the faq.

CDT 7.0 won't be released until the end of June, but you could try milestone builds to see if it does what you want. These can be downloaded here. You'll need to have a matching milestone version of the eclipse platform too.

Richard Miskin
+1  A: 

I am using this plugin:

http://www.isystem.com/downloads/downloads/204-Eclipse-Downloads.html

Hans Hubert vogts
A: 

I am trying to configure CDT error parser form CDT 7 but nothing is in Problems view. The console output contain the compiler output. Help me, please, with regex for this output from IAR compiler:

file path---------------line--------------------description

e:\WORK\source.c(14) : Error[Pe169]: expected a declaration

wassya