On 23/07/2021 09:16, Martin Liška wrote:
On 7/23/21 9:06 AM, Sebastian Huber wrote:
On 23/07/2021 08:52, Martin Liška wrote:
+#ifdef NEED_L_GCOV_INFO_TO_GCDA
+/* Convert the gcov info to a gcda data stream. It is intended for
+ free-standing environments which do not support the C library
file I/O. */
+
+void
+__gcov_info_to_gcda (const struct gcov_info *gi_ptr,
+ void (*filename) (const char *, void *),
What about begin_finaname_fn?
+ void (*dump) (const void *, unsigned, void *),
+ void *(*allocate) (unsigned, void *),
+ void *arg)
+{
+ (*filename) (gi_ptr->filename, arg);
+ write_one_data (gi_ptr, NULL, dump, allocate, arg);
+}
+#endif /* NEED_L_GCOV_INFO_TO_GCDA */
About gcov_write_summary: it should be also dumped in order to have
a complete .gcda file, right?
How can I get access to the summary information? Here it is not
available:
You only need to change gcov_write_summary in gcov-io.c.
Sorry, I still don't know how I can get the summary information if I
only have a pointer to the gcov_info structure which does not contain
a summary member.
You're right, sorry! But in your case, it will be simple to re-created
it by the script at a host system.
gcov_write_summary (gcov_unsigned_t tag, const struct gcov_summary
*summary)
{
gcov_write_tag_length (tag, GCOV_TAG_SUMMARY_LENGTH);
gcov_write_unsigned (summary->runs);
gcov_write_unsigned (summary->sum_max);
}
Where summary->runs will be 1 and sum_max is maximum counter during the
run.
This __gcov_info_to_gcda() is just a low-level piece which is necessary
to get the gcda stream from an embedded system to a host without having
to know the details of gcov. In follow up patches we could think about a
standard format to serialize the gcda stream. For this format we could
add support to the host gcov tools. One of the tools could read this
stream and output proper *.gcda files.
--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax: +49-89-18 94 741 - 08
Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/