Index: include/lldb/Host/FileSpec.h =================================================================== --- include/lldb/Host/FileSpec.h +++ include/lldb/Host/FileSpec.h @@ -365,16 +365,25 @@ IsSourceImplementationFile () const; //------------------------------------------------------------------ - /// Returns true if the filespec represents path that is relative - /// path to the current working directory. + /// Returns true if the filespec represents a relative path. /// /// @return - /// \b true if the filespec represents a current working - /// directory relative path, \b false otherwise. + /// \b true if the filespec represents a relative path, + /// \b false otherwise. //------------------------------------------------------------------ bool - IsRelativeToCurrentWorkingDirectory () const; - + IsRelative() const; + + //------------------------------------------------------------------ + /// Returns true if the filespec represents an absolute path. + /// + /// @return + /// \b true if the filespec represents an absolute path, + /// \b false otherwise. + //------------------------------------------------------------------ + bool + IsAbsolute() const; + TimeValue GetModificationTime () const; Index: source/Host/common/FileSpec.cpp =================================================================== --- source/Host/common/FileSpec.cpp +++ source/Host/common/FileSpec.cpp @@ -1482,7 +1482,7 @@ } bool -FileSpec::IsRelativeToCurrentWorkingDirectory () const +FileSpec::IsRelative() const { const char *dir = m_directory.GetCString(); llvm::StringRef directory(dir ? dir : ""); @@ -1517,3 +1517,9 @@ } return false; } + +bool +FileSpec::IsAbsolute() const +{ + return !FileSpec::IsRelative(); +} Index: source/Host/linux/HostInfoLinux.cpp =================================================================== --- source/Host/linux/HostInfoLinux.cpp +++ source/Host/linux/HostInfoLinux.cpp @@ -225,7 +225,7 @@ HostInfoLinux::ComputeSupportExeDirectory(FileSpec &file_spec) { if (HostInfoPosix::ComputeSupportExeDirectory(file_spec) && - !file_spec.IsRelativeToCurrentWorkingDirectory() && + file_spec.IsAbsolute() && file_spec.Exists()) return true; file_spec.GetDirectory() = GetProgramFileSpec().GetDirectory(); Index: source/Plugins/Platform/Android/PlatformAndroid.cpp =================================================================== --- source/Plugins/Platform/Android/PlatformAndroid.cpp +++ source/Plugins/Platform/Android/PlatformAndroid.cpp @@ -215,7 +215,7 @@ return PlatformLinux::GetFile(source, destination); FileSpec source_spec (source.GetPath (false), false, FileSpec::ePathSyntaxPosix); - if (source_spec.IsRelativeToCurrentWorkingDirectory ()) + if (source_spec.IsRelative()) source_spec = GetRemoteWorkingDirectory ().CopyByAppendingPathComponent (source_spec.GetCString (false)); AdbClient adb (m_device_id); @@ -232,7 +232,7 @@ return PlatformLinux::PutFile (source, destination, uid, gid); FileSpec destination_spec (destination.GetPath (false), false, FileSpec::ePathSyntaxPosix); - if (destination_spec.IsRelativeToCurrentWorkingDirectory ()) + if (destination_spec.IsRelative()) destination_spec = GetRemoteWorkingDirectory ().CopyByAppendingPathComponent (destination_spec.GetCString (false)); AdbClient adb (m_device_id); Index: source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp =================================================================== --- source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp +++ source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp @@ -519,14 +519,14 @@ debug_line_data.Skip_LEB128(&offset); // Skip mod_time debug_line_data.Skip_LEB128(&offset); // Skip length - if (file_spec.IsRelativeToCurrentWorkingDirectory()) + if (file_spec.IsRelative()) { if (0 < dir_idx && dir_idx < include_directories.size()) { FileSpec dir = include_directories[dir_idx]; file_spec.PrependPathComponent(dir); } - if (file_spec.IsRelativeToCurrentWorkingDirectory()) + if (file_spec.IsRelative()) file_spec.PrependPathComponent(cu_comp_dir); } std::string remapped_file; Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp =================================================================== --- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -977,7 +977,7 @@ { // If we have a full path to the compile unit, we don't need to resolve // the file. This can be expensive e.g. when the source files are NFS mounted. - if (cu_file_spec.IsRelativeToCurrentWorkingDirectory()) + if (cu_file_spec.IsRelative()) { // DWARF2/3 suggests the form hostname:pathname for compilation directory. // Remove the host part if present. Index: source/Target/ProcessLaunchInfo.cpp =================================================================== --- source/Target/ProcessLaunchInfo.cpp +++ source/Target/ProcessLaunchInfo.cpp @@ -423,7 +423,7 @@ // is a relative path. const char *argv0 = argv[0]; FileSpec arg_spec(argv0, false); - if (arg_spec.IsRelativeToCurrentWorkingDirectory()) + if (arg_spec.IsRelative()) { // We have a relative path to our executable which may not work if // we just try to run "a.out" (without it being converted to "./a.out") Index: source/Target/TargetList.cpp =================================================================== --- source/Target/TargetList.cpp +++ source/Target/TargetList.cpp @@ -412,7 +412,7 @@ if (file.GetFileType() == FileSpec::eFileTypeDirectory) user_exe_path_is_bundle = true; - if (file.IsRelativeToCurrentWorkingDirectory() && user_exe_path) + if (file.IsRelative() && user_exe_path) { // Ignore paths that start with "./" and "../" if (!((user_exe_path[0] == '.' && user_exe_path[1] == '/') ||