Author Topic: Parsing of IAR Build Output  (Read 17762 times)

Offline Neoman

  • Single posting newcomer
  • *
  • Posts: 7
Parsing of IAR Build Output
« on: June 27, 2008, 01:54:05 pm »
Hallo,

output of IAR Compiler looks like:

D:\work\Project\TTS_O\quellcode\tts_o\myFile.h(37) : Error[Pe040]: expected an identifier

How to set the regular expression to parse the outputs of IAR Compiler ?
Where to find the description how to customize the regular expression ?

(Settings/Compiler and debugger/other settings/advanced options/output parsing)

Best regards

Neoman

Offline Neoman

  • Single posting newcomer
  • *
  • Posts: 7
Re: Parsing of IAR Build Output
« Reply #1 on: July 01, 2008, 12:10:18 pm »
Please Help,

does exists a syntax documentation for the output parsing ?

Best Regards

Neoman

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5490
Re: Parsing of IAR Build Output
« Reply #2 on: July 01, 2008, 03:01:21 pm »
have a look at the syntax of the out of the box compilers. Or google around on regular expressions : I am sure you will find the solution then.

Offline Neoman

  • Single posting newcomer
  • *
  • Posts: 7
Re: Parsing of IAR Build Output
« Reply #3 on: July 02, 2008, 07:56:01 am »
Thanks for replay,

the output syntax of my compiler is clear for me. This is not the problem.
I'm looking for syntax of code::blocks output parser to parse for errors, warning etc.

How to interpret this expression ?

([][{}() \t#%$~A-Za-z0-9_:+/\.-]+):([0-9]+):[0-9]+:[ \t](.*)

How to change it for my compiler ?

Thanks for help

Neoman

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Parsing of IAR Build Output
« Reply #4 on: July 02, 2008, 08:49:26 am »
As killerbot says these are regular expressions and there are tons of documentation all over the web.
You can try this one with your error-output:
Code
([][{} \t#%$~A-Za-z0-9_:+/\.-\\]+)\(([0-9]+)\) : (.*)
with type set to "Error" and "Subexpression indices" set to:
  • Message: 3
  • Additional message 2: 0
  • Additional message 3: 0
  • Filename: 1
  • Line: 2

If you test your message you get the following output:
Code
Regular expression analyzed as follows:

Type: Error message
Filename: D:/work/Project/TTS_O/quellcode/tts_o/myFile.h
Line number: 37
Message: Error[Pe040]: expected an identifier

Offline Neoman

  • Single posting newcomer
  • *
  • Posts: 7
Re: Parsing of IAR Build Output
« Reply #5 on: July 02, 2008, 09:27:14 am »
Thanks,

my mistake was the meaning of "regular expression".
You are right, there are a lot of sites about "regular expressions".

I tried your settings, but the Test results are not the same as yours :-( 
(see attached snapshot)

Regards,

Neoman

[attachment deleted by admin]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Parsing of IAR Build Output
« Reply #6 on: July 02, 2008, 11:34:08 am »
Did you "play" with some of the regexes above the line you changed ("Linker error") ?

The first line that matches the regex is taken to create output.

Offline Neoman

  • Single posting newcomer
  • *
  • Posts: 7
Re: Parsing of IAR Build Output
« Reply #7 on: July 02, 2008, 02:16:33 pm »
You are right,

now i places a parsing expression "Test" on the first position in the list.
Testing expression works fine, but the output parsing can't catch the errors :-(

For example:

....
D:\work\MOD3000\DLL_N\quellcode\dll_n\dll_n.c(3272) : Error[Pe020]: identifier "dfgdfg" is undefined
....
Total number of errors: 2
Total number of warnings: 1

Process terminated with status 1 (0 minutes, 5 seconds)
0 errors, 0 warnings


Thanks for Your patience

Neoman

[attachment deleted by admin]

Offline Alatar

  • Multiple posting newcomer
  • *
  • Posts: 60
Re: Parsing of IAR Build Output
« Reply #8 on: April 27, 2018, 11:19:53 am »
Hello,

I currently use CB (r11367) with IAR EW ARM 7.3 to build my project and I noticed that even there is IAR support in CB, the message parsing is broken for me.
Seems like the output format was changed.
Here is actual example of the output:

Code
      bla;
      ^
"C:\_DATA_\project\main.c",83  Error[Pe020]: identifier "bla" is undefined
Errors: 1

I was able to get it work by modifying regexps as follows:
Code
-- ([][{}() \t#%$~[:alnum:]&_:+/\\.-]+),([0-9]+)[ \t]+([Ee]rror\\[[0-9A-Za-z]*\\]:.*)
++ "?([][{}() \t#%$~[:alnum:]&_:+/\.-]+)"?,([0-9]+)[ \t]+([Ee]rror\[[0-9A-Za-z]*\]:.*)

Find attached IAR-related part of CB config, that works for me. I did not test all the regexps in parser but for most common messages they are ok.
« Last Edit: April 27, 2018, 11:22:43 am by Alatar »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Parsing of IAR Build Output
« Reply #9 on: April 27, 2018, 08:56:54 pm »
Can you post a patch against the svn repo?
The compiler configurations are stored in xml files.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Alatar

  • Multiple posting newcomer
  • *
  • Posts: 60
Re: Parsing of IAR Build Output
« Reply #10 on: May 11, 2018, 06:13:07 am »
Yes, sure. Here is it.
BTW there are another several things to do to be able to use IAR for ARM CortexM development out of the box:
* remove toolchain directory from linker path list by default
* add assembler compiler

For second point currently I use workaround with redefinition of resources compiler but I think it would be good idea to add separated toolchain executable for assembler compiler.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Parsing of IAR Build Output
« Reply #11 on: October 18, 2020, 12:54:18 am »
Patch applied sorry for the delay.

* remove toolchain directory from linker path list by default
What do you mean by this?

* add assembler compiler
This would be hard. Might be useful, but not too much. The build system of C::B is probably easily overwhelmed by the the requirements of embedded projects.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Alatar

  • Multiple posting newcomer
  • *
  • Posts: 60
Re: Parsing of IAR Build Output
« Reply #12 on: October 19, 2020, 08:59:20 pm »
Thank you =)

* remove toolchain directory from linker path list by default
What do you mean by this?

Well that was some time ago, not sure I remember what it was exactly, but guess there were some problems with default value for "Compiler Settings -> Search directories -> Linker"
Can't test since I don't work with IAR anymore.

* add assembler compiler
This would be hard. Might be useful, but not too much. The build system of C::B is probably easily overwhelmed by the the requirements of embedded projects.

In embedded world it is common case where you mix C and ASM in one project. I'm fine with using "Advanced compiler option -> Commands" to compile non-c files but I don't want to hardcode executables there. I used to use $rescomp instead of asm compiler since I didn't know else I can pass there executable path. If we can define custom variables in "Compiler settings -> Toolchain executables -> Program files" that solves my issue. I don't thing it's really so hard.
BTW currently there are several predefined rules to auto generate sources from files like y, pyx and so on, but there are just calls to harcoded binaries by name. That may be very hard to find how to set them for one who doesn't know about =).