Author Topic: Capturing and parsing build output from IAR  (Read 271 times)

vandermyer

  • Community Member
  • Posts: 33
  • Hero Points: 2
Capturing and parsing build output from IAR
« on: September 02, 2022, 07:55:21 am »
I am using IAR and the IAR 'iarbuild' command to build in SE and capture build the output. Parsing this output and navigating to errors works fine until I get output of this from IAR (as it appears in IAR Embedded Workbench):

Error[Pe136]: struct "<unnamed>#16" (declared at line 162 of "C:\XXX\ProjWork\YYY\Software\Source\Application\System.h") has no field "Name"   C:\XXX\ProjWork\YYY\Software\Source\Application\System.C   852

When captured in SE, I get this:

Error[Pe136]: struct "<unnamed>#16" (declared @Hat line 162 of "C:\XXX\ProjWork\YYY\Software\Source\Application\System.h"@h) has no field "Name"   C:\XXX\ProjWork\YYY\Software\Source\Application\System.C   852   

Those @H and @h sequences are characters to delimit a link in the error message and are actually the hexadecimal codes "0148" hex at lnik start and "0168" at link end. (I used '@' to represent "01" hex in line above).

These link delimiters mess up the output capture and these lines appear in the caputred Output (in SE) as not having end-of-lines and all merge into a single long line of ouptut that I fail to parse.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1744
  • Hero Points: 148
Re: Capturing and parsing build output from IAR
« Reply #1 on: September 08, 2022, 04:03:23 pm »
I can reproduce this.  It wasn't what I thought.  We use the SOH (0x01) char as a leader for side channel commands to the build window, and that's what's kicking in and mangling things. 

I haven't thought of a workaround.  Or a helpful command line program on windows you can pipe iarbuild through to strip the non-printable control characters before we see them.  If you have one of the packages of unix command line tools for windows, it's probably doable with sed.  Just stripping the 0x1 chars will still leave you with a uglier error regular expression, with file paths surrounded by "." and "0", but it should work.