On 20/11/2020 16:25, Martin Liška wrote:

Apart from these 2 hooks, I bet you will also need gcov_position and gcov_seek functions,
can be seen in my sent patch.
For what do I need them?


I prefer the way with the 2 extra hooks.
Can you please prepare a patch where the newly added functions __gcov_info_to_gcda and __gcov_fn_info_to_gcda will be used in libgcov (with the hooks equal to fopen and fwrite?

I am not really sure what I should do. Do you mean that write_one_data() should be rewritten to use __gcov_info_to_gcda() with hooks that use gcov_write_unsigned()?

The write_one_data() also has a const struct gcov_summary *prg_p pointer. What should an external user provide for this pointer? For example &gi_ptr->summary?

The write_one_data() has this code

      if (fn_buffer && fn_buffer->fn_ix == f_ix)
        {
          /* Buffered data from another program.  */
          buffered = 1;
          gfi_ptr = &fn_buffer->info;
          length = GCOV_TAG_FUNCTION_LENGTH;
        }

which uses a global variable

/* buffer for the fn_data from another program.  */
static struct gcov_fn_buffer *fn_buffer;

For this handling we would need a new hook to do this:

      if (buffered)
        fn_buffer = free_fn_data (gi_ptr, fn_buffer, GCOV_COUNTERS);

I don't know for what we need seek and position hooks.

--
embedded brains GmbH
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
PGP: Public key available on request.

embedded brains GmbH
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/

Reply via email to