def symbols(arch)
      symbolications     = Symbols.new
      current_subprogram = nil

      stdin, stdout, stderr = Open3.popen3('dwarfdump', '--debug-info', "--arch=#{arch}", @dsym)
      stdout.each_line do |line|
        if current_subprogram
          if line =~ /^\s*AT_(\w+)\(\s*(.+?)\s*\)$/
            tag   = $1
            value = $2

            case tag
              when 'name', 'decl_file' # quoted strings
                value = value[1..-2]
              when 'decl_line' # decimal integers
                value = value.to_i
              when 'prototyped', 'external' # booleans
                value = (value == '0x01')
              when 'low_pc', 'high_pc' # hex integers
                value = value.hex
            end

            current_subprogram[tag] = value
          elsif line =~ /^0x[0-9a-f]+:\s+TAG_(\w+)/
            next unless %w(low_pc high_pc decl_file decl_line name).all? { |k| current_subprogram.include? k }
            current_subprogram['decl_file'].sub!(/^#{Regexp.escape @project_dir}\//, '') if @project_dir
            symbolications.add current_subprogram['low_pc'],
                               current_subprogram['high_pc'],
                               current_subprogram['decl_file'],
                               current_subprogram['decl_line'],
                               current_subprogram['name']

            current_subprogram = ($1 == 'subprogram') ? Hash.new : nil
          end
        else
          if line =~ /^0x[0-9a-f]+:\s+TAG_subprogram\s+\[\d+\]\s+\*$/
            current_subprogram = Hash.new
          end
        end
      end

      return symbolications
    end
def symbols(arch)
      symbolications     = Symbols.new
      current_subprogram = nil

      stdin, stdout, stderr = Open3.popen3('dwarfdump', '--debug-info', "--arch=#{arch}", @dsym)
      stdout.each_line do |line|
        if current_subprogram
          if line =~ /^\s*AT_(\w+)\(\s*(.+?)\s*\)$/
            tag   = $1
            value = $2

            case tag
              when 'name', 'decl_file' # quoted strings
                value = value[1..-2]
              when 'decl_line' # decimal integers
                value = value.to_i
              when 'prototyped', 'external' # booleans
                value = (value == '0x01')
              when 'low_pc', 'high_pc' # hex integers
                value = value.hex
            end

            current_subprogram[tag] = value
          elsif line =~ /^0x[0-9a-f]+:\s+TAG_(\w+)/
            next unless %w(low_pc high_pc decl_file decl_line name).all? { |k| current_subprogram.include? k }
            current_subprogram['decl_file'].sub!(/^#{Regexp.escape @project_dir}\//, '') if @project_dir
            symbolications.add current_subprogram['low_pc'],
                               current_subprogram['high_pc'],
                               current_subprogram['decl_file'],
                               current_subprogram['decl_line'],
                               current_subprogram['name']

            current_subprogram = ($1 == 'subprogram') ? Hash.new : nil
          end
        else
          if line =~ /^0x[0-9a-f]+:\s+TAG_subprogram\s+\[\d+\]\s+\*$/
            current_subprogram = Hash.new
          end
        end
      end

      return symbolications
    end
Extracts symbol information from the dSYM.

 @param [String] arch The architecture to extract symbols for.
 @return [Symbols] The symbols defined in the dSYM.
 @see #architectures