def backtrace_locations_to_captions(locations)
      locs = nil
      if locations.size > 9 then
        locs = (locations[0..3].map{|x| "from #{x.to_s}"} + [" ... (#{locations.size - 8} frames) ..."] + locations[-4..-1].map{|x| "from #{x.to_s}"})
      else
        locs = locations.map{|x| "from #{x.to_s}"}
      end

      if locs.size >= 1 then
        locs.first.sub!(/\A\s*from /, '')
      end

      locs
    end
def backtrace_locations_to_captions(locations)
      locs = nil
      if locations.size > 9 then
        locs = (locations[0..3].map{|x| "from #{x.to_s}"} + [" ... (#{locations.size - 8} frames) ..."] + locations[-4..-1].map{|x| "from #{x.to_s}"})
      else
        locs = locations.map{|x| "from #{x.to_s}"}
      end

      if locs.size >= 1 then
        locs.first.sub!(/\A\s*from /, '')
      end

      locs
    end
Thread::Backtrace::Locationのリストを文字列形式に変換。フレーム数が多すぎる場合は途中を省略