This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch libgcov]: Fix libgcov for DOS paths and allow GCOV_PREFIX_STRIP without GCOV_PREFIX


On Fri, Oct 15, 2010 at 1:36 PM, Richard Henderson <rth@redhat.com> wrote:
> On 10/15/2010 12:37 PM, Kai Tietz wrote:
>> ? ? ? ? * libgcov.c (create_file_directory): Enable it for win32 case.
>
> I think this part can go in immediately. ?Obvious and non-controversial.
>
>> ? ? ? ? (gcov_exit): De-couple GCOV_PREFIX and GCOV_PREFIX_STRIP.
>
>> + ?/* If no prefix was specified and a prefix stip, then we assume
>> + ? ? relative. ?*/
>> + ?if (gcov_prefix_strip != 0 && prefix_length == 0)
>> + ? ?{
>> + ? ? ?gcov_prefix = ".";
>> + ? ? ?prefix_length = 1;
>> + ? ?}
>
> I wonder if it would be better to generate "file" than "./file".
> This could be done instead by changing
>
>> ? if (prefix_length)
>> ? ? memcpy (gi_filename, gcov_prefix, prefix_length);
>
> to force a separator here instead.
>
> And of course if we're allowing relative paths via this method, it
> does seem odd that we'd reject them via GCOV_PREFIX. ?I see that
> Grigory argues against relative prefixes back in
>
> ?http://gcc.gnu.org/ml/gcc-patches/2005-05/msg00545.html
>
> The very specific (and common) use case we're looking at here is that
> of the testsuite, where we have a cygwin host and a mingw target. The
> host and target do not share a common view of the filesystem. ?Cygwin
> thinks the path from root is /home/user/.../gcc/testsuite/ and MinGW
> thinks the path from root is C:/cygwin/home/user/.../gcc/testsuite/.
>
> For the testsuite (and indeed, many cygwin/mingw cross situations),
> using relative paths enables this disparate vision to be ignored.
>

Relative GCOV_PREFIX is fine with me if it helps.

-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]