Home » Language IDEs » C / C++ IDE (CDT) » Error parser for external tool
Error parser for external tool [message #204076] |
Mon, 05 November 2007 05:35  |
Eclipse User |
|
|
|
Originally posted by: ups_genius.gmx.net
Hi everyone!
I created an error parser using the existing CDT stuff by basically
copying some of the GNU / make / ... error parsers' code. I also added the
extension point for the new error parser, and by debugging I see, that
when activated, the new error parser is actually used to parse the regular
build output.
The reason for writing this error parser though was to parse the output
produced by a batch file, run as "external tool". And this is what does
not work. The batch output is written to what seems to be another
"instance" of the console than the regular make/build output. And the
output to this console is not parsed by any of the error parsers.
Can anyone tell me how to run the error parser on this output? It does not
necessarily have to be in the way I tried it so far, any solution would be
helpful.
By the way: Is there maybe already a plugin that provides a configurable
output/error parser (e.g. like in textpad: regex for error output is
configurable per "external tool")
Thanks in advance,
Christian
|
|
| | | |
Re: Error parser for external tool [message #204187 is a reply to message #204180] |
Tue, 06 November 2007 07:12   |
Eclipse User |
|
|
|
Originally posted by: ups_genius.gmx.net
Hi Ron!
Ron Bermejo wrote:
> Hello Christian!
> Christian Opitz wrote:
>> Ron Bermejo wrote:
>>> Yup, the "External Tool" function is contributed by the org.eclipse.debug
>>> plug-ins. You can try which extension points below are suitable for your
>>> needs:
>>> org.eclipse.debug.ui.consoleLineTrackers
>>> org.eclipse.ui.console.consolePatternMatchListeners
>>> Hth!
>>> Ron
>> This helps a lot! Thank you very much!
>> I am not quite sure how to use the existing functionality and what to add
>> myself yet, but at least now I have a point to start.
>> Have you done something similar before?
> Not really :-) I have only used the cdt errorparser extension point before.
> BTW, are you sure you can't just use a CDT build console for this? e.g.,
> create a custom make target to run the batch file (for makefile projects).
> The reason I'm asking is that you will "lose" some features (such as
> problem marker generation) if you use the generic console extension
> points, and will have to reimplement them in your plug-in. You can take a
> look at ErrorParserManager#generateMarker() and ACBuilder#addMarker() on
> how this is done.
> Hth!
> Ron
Thanks again!
I am not sure if this works, since I have at least 2 different batch
files, that I would like to run, both needing the selected directory/file
as parameter. One of the batch files is for a special build, the other one
is for a kind of code evaluation - so both do not really have the actual
project build functionality...
I am not so familiar with target configurations, but I will try it - it
seems to be the easier way compared to doing everything by myself in a new
plugin. I don't know where to start yet, but we will see...
Christian
|
|
|
Re: Error parser for external tool [message #204249 is a reply to message #204166] |
Wed, 07 November 2007 04:01   |
Eclipse User |
|
|
|
Originally posted by: mba.cosmigo.ru
Hi Christian,
I've got some experience with
org.eclipse.ui.console.consolePatternMatchListeners extension point. I
was able to parse output of our project to find lines with
__FILE__:__LINE__ output and even make links from console to code. But
as Ron had written in next post, I haven't yet found a way to add a
marker to Problems view. If you find a solution - please share your
experience.
Christian Opitz wrote:
> Ron Bermejo wrote:
>
>> Hello Christian!
>
>> Christian Opitz wrote:
>
>>> Hi everyone!
>
>>> I created an error parser using the existing CDT stuff by basically
>>> copying some of the GNU / make / ... error parsers' code. I also
>>> added the extension point for the new error parser, and by debugging
>>> I see, that when activated, the new error parser is actually used to
>>> parse the regular build output.
>
>>> The reason for writing this error parser though was to parse the
>>> output produced by a batch file, run as "external tool". And this is
>>> what does not work. The batch output is written to what seems to be
>>> another "instance" of the console than the regular make/build output.
>>> And the output to this console is not parsed by any of the error
>>> parsers.
>
>>> Can anyone tell me how to run the error parser on this output? It
>>> does not necessarily have to be in the way I tried it so far, any
>>> solution would be helpful.
>
>> Yup, the "External Tool" function is contributed by the
>> org.eclipse.debug plug-ins. You can try which extension points below
>> are suitable for your needs:
>> org.eclipse.debug.ui.consoleLineTrackers
>> org.eclipse.ui.console.consolePatternMatchListeners
>
>> Hth!
>> Ron
>
>
> This helps a lot! Thank you very much!
> I am not quite sure how to use the existing functionality and what to
> add myself yet, but at least now I have a point to start.
>
> Have you done something similar before?
>
> Thanks again!
> Christian
>
>
--
Best regards
Mikhail Barg
ICQ: 132560784
|
|
| | | | |
Re: Error parser for external tool [message #204479 is a reply to message #204472] |
Fri, 09 November 2007 04:04   |
Eclipse User |
|
|
|
Originally posted by: mba.cosmigo.ru
Hi Ron,
Ron Bermejo wrote:
> Regarding adding markers to the Problems view, you can do this using
> IResource#addMarker().
Wow, it works! Thanks a lot! Now it'll have to think of when I want to
remove the markers... But it's a my design problems..
> So, the real problem is converting the (String)
> filename that you would get from the regexp, to the correct IResource
> object.
> You can have a look at how ErrorParserManager does this. Or, maybe you
> could even just create an instance of ErrorParserManager somewhere (e.g.
> during connect(IConsole)) and write() all matching lines to it.
I've already managed to do this with ISourceLookupDirector, but it works
only for files which actually exist in the project, not in /includes, as
I wrote in "ISourceLookupDirector and included files" thread.. I'll try
checking ErrorParserManager a bit deeper. Thanks again.
--
Best regards
Mikhail Barg
ICQ: 132560784
|
|
| | | |
Goto Forum:
Current Time: Tue Jul 08 07:23:12 EDT 2025
Powered by FUDForum. Page generated in 0.09309 seconds
|