Пример #1
0
data::colored_string console_displayer::format_frame(const data::frame& f_)
{
  data::colored_string prefix;
  if (f_.is_profiled())
  {
    prefix = "[" + format_time(f_.time_taken()) + ", " +
             format_ratio(f_.time_taken_ratio()) + "] ";
  }

  std::ostringstream postfix;
  if (f_.is_full())
  {
    postfix << " at " << f_.source_location() << " (" << f_.kind() << " from "
            << f_.point_of_instantiation() << ")";
  }
  return prefix + format_code(f_.type().name()) + postfix.str();
}
Пример #2
0
data::colored_string console_displayer::format_frame(const data::frame& f_)
{
  data::colored_string prefix;
  if (const auto t = f_.time_taken())
  {
    const auto r = f_.time_taken_ratio();
    assert(bool(r));
    prefix = "[" + format_time(*t) + ", " + format_ratio(*r) + "] ";
  }

  std::ostringstream postfix;
  if (f_.is_full())
  {
    postfix << " at " << f_.source_location() << " (" << f_.kind() << " from "
            << f_.point_of_event() << ")";
  }
  return prefix + format_metaprogram_node(f_.node()) + postfix.str();
}
Пример #3
0
  void mdb_shell::display_frame(const data::frame& frame,
                                iface::displayer& displayer_) const
  {
    displayer_.show_frame(frame);

    data::file_location source_location = frame.source_location();
    if (source_location.name == _env_path)
    {
      // We don't want to show stuff from the internal header
      source_location = data::file_location();
    }
    // TODO: we should somehow compensate the file_locations returned by
    // clang for the <stdin> file. This is hard because the file clang sees
    // is just two lines (an include for the PCH and the current line)
    // Until this is figured out, printing file sections for <stdin> is
    // turned off
    // displayer_.show_file_section(source_location, env.get());
    displayer_.show_file_section(source_location, "");
  }