[hg at technosis.de: [Bug 145687] New: Makeactionfilter fails to parse compiler build output]

Andreas Pakulat apaku at gmx.de
Thu May 24 01:20:24 UTC 2007


Hi,

I'd like to apply the patch, but before that I'd like to know wether
there's a reason why the makeactionfilter doesn't filter based on
file extension? If there is I'll commit just the first change he
proposes, else I'll commit the more extensive change which simplifies
the regexpes a bit (I can't even read them at the moment).

Andreas

----- Forwarded message from Heiko Gerdau <hg at technosis.de> -----

From: Heiko Gerdau <hg at technosis.de>
To: kdevelop-bugs at kdevelop.org
Subject: [Bug 145687] New: Makeactionfilter fails to parse compiler build
	output 

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=145687         
           Summary: Makeactionfilter fails to parse compiler build output
           Product: kdevelop
           Version: 3.4.1
          Platform: unspecified
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: Output Views
        AssignedTo: kdevelop-bugs kdevelop org
        ReportedBy: hg technosis de


Version:           3.4.1 (using KDE 3.5.5 "release 45" , openSUSE 10.2)
Compiler:          Target: i586-suse-linux
OS:                Linux (i686) release 2.6.18.2-34-default

Hi,

the makeactionfilters do not correctly parse the output from the build process for the following example:

"g++ -c  -o test.o -myoptions -I/mypath test.cpp"

If the makeactionfilters parse this line they create the following modified short version for the message view:
"compiling mypath (g++)"
but it should be
"compiling test.cpp (g++)"

Based on the kdevelop-3.4.1 release this could be easily fixed by adding "(?:-\S*\s*)*" to the RegExp in kdevelop-3.4.1/parts/outputviews/makeactionfilter.cpp line 76. Change
ActionFormat( i18n("compiling"), 1, 2, "(gcc|CC|cc|distcc|c\\+\\+|g\\+\\+)\\S* (?:\\S* )*-c (?:\\S* )*-o (?:\\S* )(?:[^/;]*/)*([^/\\s;]+)"),

into 

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

This is a minimal change to resolve the problem but I would rather suggest the following RegExp to match all compile testcases with a single and easier RegExp.

(?:^|[^=])\b(gcc|CC|cc|distcc|c\+\+|g\+\+)\s+.*-c.*[/ '\\]+(\w+\.(?:cpp|c))

It's based on the file extensions and supports also MS Windows type path separators which might be an issue in the future.
There might be a reason why you don't use file extensions for the regexp in the first place. So sorry if I have overseen something.

Anyway here is the proposed patch:

--- makeactionfilter.ori.cpp	2007-05-19 21:12:26.000000000 +0200
+++ makeactionfilter.cpp	2007-05-19 21:20:00.000000000 +0200
 @ -72,9 +72,7  @
 MakeActionFilter::ActionFormat* MakeActionFilter::actionFormats()
 {
 	static ActionFormat formats[] = {
-		ActionFormat( i18n("compiling"), 1, 2, "(gcc|CC|cc|distcc|c\\+\\+|g\\+\\+)\\S* (?:\\S* )*-c (?:\\S* )*`[^`]*`(?:[^/\\s;]*/)*([^/\\s;]+)"),
-		ActionFormat( i18n("compiling"), 1, 2, "(gcc|CC|cc|distcc|c\\+\\+|g\\+\\+)\\S* (?:\\S* )*-c (?:\\S* )*-o (?:\\S* )(?:[^/;]*/)*([^/\\s;]+)"),
-		ActionFormat( i18n("compiling"), 1, 2, "(gcc|CC|cc|distcc|c\\+\\+|g\\+\\+)\\S* (?:\\S* )*-c (?:\\S* )*(?:[^/]*/)*([^/\\s;]*)"),
+		ActionFormat( i18n("compiling"), 1, 2, "(?:^|[^=])\\b(gcc|CC|cc|distcc|c\\+\\+|g\\+\\+)\\s+.*-c.*[/ '\\\\]+(\\w+\\.(?:cpp|c))"),
 		ActionFormat( i18n("compiling"), 1, 1, "^compiling (.*)" ), //unsermake
 		ActionFormat( i18n("compiling"), 1, 1, "\\[.+%\\] Building .* object (.*)" ), //cmake
 
 @ -172,6 +170,10  @
 		"g++ -c -pipe -Wall -W -O2 -DQT_NO_DEBUG -I/home/john/src/kde/qt-copy/mkspecs/default -I. "
 		"-I/home/john/src/kde/qt-copy/include -o test.o test.cpp",
 		"compiling", "g++", "test.cpp" )
+	<< TestItem( // simple qmake compile different option order
+		"g++ -c -o test.o -pipe -Wall -W -O2 -DQT_NO_DEBUG -I/home/john/src/kde/qt-copy/mkspecs/default -I. "
+		"-I/home/john/src/kde/qt-copy/include test.cpp",
+		"compiling", "g++", "test.cpp" )
 	<< TestItem( // simple qmake link
 		"g++ -o ../bin/test test.o -Wl,-rpath,/home/john/src/kde/qt-copy/lib -L/home/john/src/kde/qt-copy/lib "
 		"-L/usr/X11R6/lib -lqt-mt -lXext -lX11 -lm",

_______________________________________________
KDevelop-bugs mailing list
KDevelop-bugs at kdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-bugs

----- End forwarded message -----

-- 
You may be gone tomorrow, but that doesn't mean that you weren't here today.




More information about the KDevelop-devel mailing list