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


2010/10/15 Richard Henderson <rth@redhat.com>:
> 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

Well, this is a bit tricky as we would change here default behavior.
Problem is here for absolute paths and initial relative and its
merging. So I would prefer for the case that no gcov_prefix was
specified, but gcov_prefix_strip is given to use here './'. This ease
logic and keeps old behavior. The attached patch allows relative paths
for GCOV_PREFIX and fixes an issue in directory generation for win32.
Old code tried to use for absolute paths ":" as directory to probe.

>> ? if (prefix_length)
>> ? ? memcpy (gi_filename, gcov_prefix, prefix_length);
>
> to force a separator here instead.

Well, for relative file names I handle the path separation in final
file generation. At this point is would lead to sematic differences
for relative/absolute (and here in special for DOS filesystem).

> 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.
>
> Comments?
>
>
> r~
>

Tested for x86_64-w64-mingw32, and i686-pc-cygwin. Ok for apply?

Regards,
Kai

-- 
|? (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination

Attachment: gcov_strip.diff
Description: Binary data


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