MakeActionFilter for compiler output view

hg hg at technosis.de
Fri May 18 22:58:20 BST 2007


Hi,

in kdevelop output from the build process is parsed and may be displayed in a 
modified short version in the message view.

For instance your filter converts messages like:
"g++ -c -myoptions -I/mypath -o test.o test.cpp"
into
"compiling test.cpp (g++)".

The problem:
=========
I have lots of projects with custom makefiles where the '-o filename.o' option 
is placed right after the -c flag. Than your filter fails.
For example:
Parsing
"g++ -c  -o test.o -myoptions -I/mypath test.cpp"
your filter wrongly converts it to:
"compiling mypath (g++)".


I took a look at the source in 
kdevelop-3.4.1/parts/outputviews/makeactionfilter.cpp and found the RegExp in 
line 76 to be responsible.

ActionFormat( i18n("compiling"), 1, 2, "(gcc|CC|cc|distcc|c\\+\\+|g\\+\\+)\\S* 
(?:\\S* )*-c (?:\\S* )*-o (?:\\S* )(?:[^/;]*/)*([^/\\s;]+)"),

Trying not to change the regexp to much I inserted the term "(?:-\S*\s*)*". 
Could you consider to insert that additional term on line 76 than it would 
support both versions without breaking anything (as far as I can tell without 
building a debug version). The complete line would be:

ActionFormat( i18n("compiling"), 1, 2, "(gcc|CC|cc|distcc|c\\+\\+|g\\+\\+)\\S* 
(?:\\S* )*-c (?:\\S* )*-o (?:\\S* )(?:-\\S*\\s*)*(?:[^/;]*/)*([^/\\s;]+)"),

Could you please verify this?
 
By the way: Why don't you pick the filename by the file extension?

Best wishes
Heiko




More information about the KDevelop mailing list