https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89961

--- Comment #6 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Cristian Morales Vega from comment #5)
> OK, trying to catch you here, from my gcc-8.3.1.
> So with gcc 9 "--intermediate-format" is gone and we now have
> "--json-format" (keeping the "-i" version)? 
> 
> The "--intermediate-format" documentation used to say "can be used by lcov
> or other tools". I guess the lcov devs know about this, but aren't the devs
> of "other tools" going to be cross? I mean, I was suggesting to cmake to use
> "--intermediate-format"
> (https://gitlab.kitware.com/cmake/cmake/issues/19124#note_554428)... now
> they would need to support two formats to be able to support different gcov
> versions.
> 
> 
> In any case I'm unsure how "current_working_directory" or "data_file" help
> with the cmake case. The problem is that cmake is going to call gcov once
> and it's going to create
> 
> /tmp/error.cpp.gcda.gcov.json.gz
> 
> with whatever contents, based on what
> CMakeFiles/<cmake_target_name1>.dir/src/error.cpp.gcda says.
> 
> Then it's going to call gcov again, it's going to overwrite/destroy the
> /tmp/error.cpp.gcda.gcov.json.gz file created one second ago, and in its
> place is going to create a new
> 
> /tmp/error.cpp.gcda.gcov.json.gz
> 
> file based on what test/CMakeFiles/<cmake_target_name2>.dir/error.cpp.gcda
> says.
> 
> So all the information contained on
> CMakeFiles/<cmake_target_name1>.dir/src/error.cpp.gcda gets lost.
> 
> 
> Sure, cmake could put the files in different directories to avoid

Well, if cmake is overwriting the content, then it should be fixed on cmake
side.

> overwriting them, but it doesn't. And if cmake could do "-x -i" I would end
> up with two files:
> 
> /tmp/error.cpp.gcda##3626990101906c77dbd16dea3f1aab07.gcov.json.gz
> /tmp/error.cpp.gcda##39f7c940c3bc30bbedebd034d8c16a68.gcov.json.gz
> 
> and so no information would be lost.

This is a workaround and I don't like it much.

Reply via email to