Sha256: 02e3527ef165e2b06fd6fc1861f81d33d12ceb129349cae452c4cd6e4d3dc50c

Contents?: true

Size: 1.22 KB

Versions: 86

Compression:

Stored size: 1.22 KB

Contents

require 'bake/toolchain/errorparser/error_parser'

module Bake
  class DiabLinkerErrorParser < ErrorParser

    def initialize()
      @error_expression = /dld: ([A-Za-z]+): (.+)/
      @error_expression_linkerscript = /dld: \"([^\"]+)\", line ([0-9]+): (.+)/
    end

    def scan_lines(consoleOutput, proj_dir)
      res = []
      error_severity = 255
      consoleOutput[0].each_line do |l|
        l.rstrip!
        d = ErrorDesc.new
        scan_res = l.scan(@error_expression)
        scan_res2 = l.scan(@error_expression_linkerscript)
        if scan_res.length == 0 and scan_res2.length == 0 # msg will end with the beginning of the next message
          d.severity = error_severity
          d.message = l
        elsif scan_res.length > 0
          d.file_name = proj_dir
          d.line_number = 0
          d.message = scan_res[0][1]
          d.severity = get_severity(scan_res[0][0])
          error_severity = d.severity
        else
          d.file_name = proj_dir+"/"+scan_res2[0][0]
          d.line_number = scan_res2[0][1].to_i
          d.message = scan_res2[0][2]
          d.severity = SEVERITY_ERROR
          error_severity = d.severity
        end
        res << d
      end
      [res, consoleOutput[0]]
    end

  end
end

Version data entries

86 entries across 86 versions & 1 rubygems

Version Path
bake-toolkit-2.29.0 lib/bake/toolchain/errorparser/diab_linker_error_parser.rb
bake-toolkit-2.28.1 lib/bake/toolchain/errorparser/diab_linker_error_parser.rb
bake-toolkit-2.28.0 lib/bake/toolchain/errorparser/diab_linker_error_parser.rb
bake-toolkit-2.27.0 lib/bake/toolchain/errorparser/diab_linker_error_parser.rb
bake-toolkit-2.26.1 lib/bake/toolchain/errorparser/diab_linker_error_parser.rb
bake-toolkit-2.26.0 lib/bake/toolchain/errorparser/diab_linker_error_parser.rb
bake-toolkit-2.25.1 lib/bake/toolchain/errorparser/diab_linker_error_parser.rb
bake-toolkit-2.25.0 lib/bake/toolchain/errorparser/diab_linker_error_parser.rb
bake-toolkit-2.24.6 lib/bake/toolchain/errorparser/diab_linker_error_parser.rb
bake-toolkit-2.24.5 lib/bake/toolchain/errorparser/diab_linker_error_parser.rb
bake-toolkit-2.24.4 lib/bake/toolchain/errorparser/diab_linker_error_parser.rb
bake-toolkit-2.24.3 lib/bake/toolchain/errorparser/diab_linker_error_parser.rb
bake-toolkit-2.24.2 lib/bake/toolchain/errorparser/diab_linker_error_parser.rb
bake-toolkit-2.24.1 lib/bake/toolchain/errorparser/diab_linker_error_parser.rb
bake-toolkit-2.24.0 lib/bake/toolchain/errorparser/diab_linker_error_parser.rb
bake-toolkit-2.23.12 lib/bake/toolchain/errorparser/diab_linker_error_parser.rb
bake-toolkit-2.23.8 lib/bake/toolchain/errorparser/diab_linker_error_parser.rb
bake-toolkit-2.23.7 lib/bake/toolchain/errorparser/diab_linker_error_parser.rb
bake-toolkit-2.23.6 lib/bake/toolchain/errorparser/diab_linker_error_parser.rb
bake-toolkit-2.23.5 lib/bake/toolchain/errorparser/diab_linker_error_parser.rb