[RFA/commit] Improve gdb_realpath for Windows hosts

asmwarrior asmwarrior@gmail.com
Tue Dec 27 14:12:00 GMT 2011


Can you explain that why you avoid converting to lowercase?

>   /* The file system is case-insensitive but case-preserving.
>      So we do not lowercase the path.  Otherwise, we might not
>      be able to display the original casing in a given path.  */

I just thought that lowercase is another canonization of path, so you can have a uniform path when you set breakpoints(file specification)

The original code in iberty library is like:

>   /* The MS Windows method.  If we don't have realpath, we assume we
>      don't have symlinks and just canonicalize to a Windows absolute
>      path.  GetFullPath converts ../ and ./ in relative paths to
>      absolute paths, filling in current drive if one is not given
>      or using the current directory of a specified drive (eg, "E:foo").
>      It also converts all forward slashes to back slashes.  */
> #if defined (_WIN32)
>   {
>     char buf[MAX_PATH];
>     char* basename;
>     DWORD len = GetFullPathName (filename, MAX_PATH, buf, &basename);
>     if (len == 0 || len > MAX_PATH - 1)
>       return xstrdup (filename);
>     else
>       {
>     /* The file system is case-preserving but case-insensitive,
>        Canonicalize to lowercase, using the codepage associated
>        with the process locale.  */
>         CharLowerBuff (buf, len);
>         return xstrdup (buf);
>       }
>   }
> #endif

Thanks.

asmwarrior
ollydbg from codeblocks' forum




More information about the Gdb-patches mailing list