Index: include/lldb/Host/FileSpec.h =================================================================== --- include/lldb/Host/FileSpec.h +++ include/lldb/Host/FileSpec.h @@ -510,10 +510,7 @@ } bool - IsSymbolicLink () const - { - return GetFileType() == FileSpec::eFileTypeSymbolicLink; - } + IsSymbolicLink () const; //------------------------------------------------------------------ /// Get the memory cost of this object. Index: source/Host/common/FileSpec.cpp =================================================================== --- source/Host/common/FileSpec.cpp +++ source/Host/common/FileSpec.cpp @@ -789,6 +789,28 @@ return eFileTypeInvalid; } +bool +FileSpec::IsSymbolicLink () const +{ + char resolved_path[PATH_MAX]; + if (!GetPath (resolved_path, sizeof (resolved_path))) + return false; + +#ifdef _WIN32 + auto attrs = ::GetFileAttributes (resolved_path); + if (attrs == INVALID_FILE_ATTRIBUTES) + return false; + + return (attrs & FILE_ATTRIBUTE_REPARSE_POINT); +#else + struct stat file_stats; + if (::lstat (resolved_path, &file_stats) != 0) + return false; + + return (file_stats.st_mode & S_IFMT) == S_IFLNK; +#endif +} + uint32_t FileSpec::GetPermissions () const {