Page 1 of 1

Error patterns for custom compiler via makefile

Posted: Mon Apr 28, 2014 5:50 pm
by Gonzales
Hi there,

I must admit I am totally new to CodeLite and this question may even be stupid, but I am stuggling with the error patterns for a specific compiler.

We use the VisualDSP++ 3.5 compiler from AnalogDevices (which seems to be a GCC derivate) but the IDE is pretty lame.

For simplicity sake I am using a makefile exported from VisualDSP++ and it builds ok in CodeLite

However, I do not get any error patterns to match.

The output of a sample error looks like this:

.\Debug\main.doj: D:\Dev\Test\Softw".\main.cpp", line 12: cc0020: error: identifier "I_am_a_test_bug" is

My (very simple) regex: [^"]*"([^"]*).*line\s+([0-9]*):\s(.+):\s+error:\s+(.*)
File:1
Line:2

This works ok in RegexCoach -> File:.\main.cpp Line:12

The output has only a relative path to the file. The actual path is
D:\Dev\Test\Software\ALotOfDirectoriesHere\main.cpp

Could that be the problem? Anybody an idea how to fix this?

Any help is appreciated
Tobi

Re: Error patterns for custom compiler via makefile

Posted: Mon Apr 28, 2014 6:04 pm
by eranif
Hi Tobi,
Gonzales wrote:This works ok in RegexCoach -> File:.\main.cpp Line:12
This also works in codelite

Its always a better choice to test it within codelite (since it uses the same regex engine as the compiler output parser):
* Paste the input string in empty editor
* Ctrl-F to open the Find-Bar and check the 'Regex' option on the right
Gonzales wrote:However, I do not get any error patterns to match
Does it mean that the error line is not coloured in red? or ... ?

Did you try to use these regexes within codelite's build configuration?
If not, you need to do these steps:
- Check which compiler your project is set to work against (even if its custom build using makefile):
right click the project icon -> settings -> common settings -> general -> compiler
- Now that you know the compiler name:
from the menu bar: settings -> build settings -> compilers -> <your compiler name> -> Patterns
Replace an existing pattern (or create a new one)
File name index: 1
Line number index: 2

HTH,
Eran

Re: Error patterns for custom compiler via makefile

Posted: Tue Apr 29, 2014 3:23 pm
by Gonzales
Thanks for the help Eran.

I found my problem. It was indeed my regex (and yes the line with the error was not marked red).

The \s I used (incorrectly?) to match whitespace caused the problem

This one fails to match:
[^"]*"([^"]*).*line\s+([0-9]*):\s(.+):\s+error:\s+(.*)

This one works:
^[^"]*"([^"]*).+line[ ]*([0-9]*): ([^:]*):.*error.*

I know most "regex" programmers would probably do a better job but it seems to catch all of the build errors up to now.

Amazing tool you guys came up with

Regards
Tobi