- /* function:<name>,<line_number>,<execution_count> */
- fprintf (gcov_file, "function:%d,%d,%s,%s\n", (*it)->start_line,
- (*it)->end_line, format_gcov ((*it)->blocks[0].count, 0, -1),
- flag_demangled_names ? (*it)->demangled_name : (*it)->name);
+ json::object *function = new json::object ();
+ function->set ("name", new json::string ((*it)->m_name));
+ function->set ("demangled_name",
+ new json::string ((*it)->get_demangled_name ()));
+ function->set ("start_line", new json::number ((*it)->start_line));
+ function->set ("end_line", new json::number ((*it)->end_line));
+ function->set ("blocks",
+ new json::number ((*it)->get_block_count ()));
+ function->set ("blocks_executed",
+ new json::number ((*it)->blocks_executed));
+ function->set ("execution_count",
+ new json::number ((*it)->blocks[0].count));
+
+ functions->append (function);