Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse CDT Custom Compiler Error Parsing Plugin

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

like image 868
Ryu Avatar asked Sep 27 '26 23:09

Ryu


1 Answers

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.

like image 162
crazyscot Avatar answered Sep 30 '26 13:09

crazyscot