This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 88976

Summary: Need a handle to the code that parses the compiled output and feeds the output window
Product: cnd Reporter: Chihin Ko <chihinko>
Component: ProjectAssignee: issues@cnd <issues>
Status: NEW ---    
Severity: blocker CC: common_debugger, ivan
Priority: P2    
Version: 5.x   
Hardware: Sun   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:

Description Chihin Ko 2006-11-08 22:21:00 UTC
The build output of fix&cont needs a handle to the code that parses the output
and feeds the output window for laborating hyperlink for errors.


email exchange between Jean and Thomas

I think what you really need is a handle not the io window but to the 
code that parses the output and feeds the output window. That would 
solve your problem. You can file an IZ against CND and we can see when 
it can get fixed but I cannot promise you a fix anytime soon. I think 
you should reconsider getting the information out of dbx and have 
NativeExecutor do all the work.

--thomas

Thomas Preisler wrote:

>>
>>
>> CHIHIN KO wrote:
>
>>>> Thomas Preisler wrote On 06?11?01? 09:05 ??,:
>>>>  
>>
>>>>>> OK, I see now from the source that if you pass in a stream of 
>>>>>> characters in to the IO windows, they will not get parsed for 
>>>>>> errors. I think your best bet is to use NativeExecutor to do the 
>>>>>> compilation . Or you can
>>>>>> handle the error parsing parsing and creating the hyperlinks your self.
>>>>>>     
>>
>>>>
>>>> I can not have NativeExecutor to do the compilation, you did the
>>>> fix&cont and dbx, remember ?
>>>>   
>
>> Couldn't you ask dbx for the command and just have NativEexecutor do it?
>
>>>> Where is the  mechnism of parsing compilation error and create 
>>>> hyperlinks ?
>>>>   
>
>> It's embedded in org.netbeans.modules.cnd.execution.OutputWindowWriter.
>>
>> --thomas
>
>>>>  
>>
>>>>>> --thomas
>>>>>> CHIHIN KO wrote:
>>>>>>
>>>>>>    
>>>
>>>>>>>> I managed dbx to generate a plain compile output and
>>>>>>>> feed it into output view that provided by cnd, as you
>>>>>>>> suggested, but the output view does not do hyperlinks,
>>>>>>>> do I need to do anything special ? or is the format of
>>>>>>>> data can't be recognized ?
>>>>>>>>
>>>>>>>> The data that feed into output view look like these :
>>>>>>>>
>>>>>>>> Fix and Continue: 0 out of 1 succeeded.
>>>>>>>> (/home/jeanko/SunStudioProjects/Welcome)welcome.cc:
>>>>>>>> "welcome.cc", line 24: Error: Can only use this within a non-static
>>>>>>>> member function.
>>>>>>>> "welcome.cc", line 24: Error: is is not defined.
>>>>>>>> "welcome.cc", line 24: Error: compile is not defined.
>>>>>>>> "welcome.cc", line 24: Error: error is not defined.
>>>>>>>> "welcome.cc", line 24: Error: Badly formed expression.
>>>>>>>> 5 Error(s) detected.
>>>>>>>> :(/home/jeanko/SunStudioProjects/Welcome)welcome.cc
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> Thx,
>>>>>>>>
>>>>>>>> - Jean
>>>>>>>>
>>>>>>>> Thomas Preisler wrote On 06?11?01? 03:44 ??,:
>>>>>>>>  
>>>>>>>>
>>>>>>>>      
>>>>
>>>>>>>>>> I think you should set up NativeExecutor to do the compilation for 
>>>>>>>>>> you. Then hyperlinks and everything else would work. If you have 
>>>>>>>>>> dbx do the compilation, you could probably just feed the raw 
>>>>>>>>>> output (not html) into the io window and it will probably parse 
>>>>>>>>>> the output for errors and setup hyperlinks.
>>>>>>>>>>
>>>>>>>>>> --thomas
>>>>>>>>>>
>>>>>>>>>> CHIHIN KO wrote:
>>>>>>>>>>
>>>>>>>>>>   
>>>>>>>>>>        
>>>>>
>>>>>>>>>>>> Thomas Preisler wrote On 06?10?31? 07:30 ??,:
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>     
>>>>>>>>>>>>          
>>>>>>
>>>>>>>>>>>>>> It is long gone. You should use 
>>>>>>>>>>>>>> org.netbeans.modules.cnd.api.execution.NativeExecutor and 
>>>>>>>>>>>>>> org.netbeans.modules.cnd.api.execution.ExecutionListener 
>>>>>>>>>>>>>> instead. It will parse the output for compilation errors and set 
>>>>>>>>>>>>>> up hyperlinks to                      
>>>>>>
>>>>>>>>>>>> Does it take HTML format for compilation errors ? because that's 
>>>>>>>>>>>> what
>>>>>>>>>>>> dbx passover to dbxgui.
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>     
>>>>>>>>>>>>          
>>>>>>
>>>>>>>>>>>>>> source files, if that is what you want. I can point you to some 
>>>>>>>>>>>>>> code so you can see how to use it. Look at for instance
>>>>>>>>>>>>>> DefaultProjectActionHandler.java:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>                      
>>>>>>
>>>>>>>>>>>>                
>>>>
>>>>>>>>  
>>>>>>>>       
>>
>>>>
>>>>
Comment 1 Vladimir Kvashin 2007-10-26 11:16:44 UTC
I need similar, though a bit different thing.
It is connected with Syntax Error Highlighting (the feature that is planned for 6.1 and is now prototyped).
It launches compiler in background, parses its output and creates annotations.
Now, in prototype, it does its own, very primitive, parsing.
This is obviously; code that parses compiler should be shared.

Comment 2 Thomas Preisler 2009-10-23 03:45:10 UTC
Reassigning to Andrew. He is working on thisnow.
Comment 3 Alexander Simon 2009-11-17 02:06:33 UTC
NB 6.8 extends tool collection description.
Now it is possible to write own output parser.
To do this you should
- define service org.netbeans.modules.cnd.execution.ErrorParserProvider
- use service in tool collection scanner
For example see SunStudio tool collection description (SunStudio.xml).
It contains scanner description:
    <scanner id="SunStudio">
Scanner points on predefined service ErrorParserProvider implementation with id "SunStudio" (org.netbeans.modules.cnd.execution.impl.SUNErrorParserProvider).
So you can create own module with own tool collection and define own service.

Does it fix issue?