summaryrefslogtreecommitdiffstats
path: root/lldb/source
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source')
-rw-r--r--lldb/source/Host/common/FileSpec.cpp8
-rw-r--r--lldb/source/Host/linux/HostInfoLinux.cpp2
-rw-r--r--lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp4
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp4
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp2
-rw-r--r--lldb/source/Target/ProcessLaunchInfo.cpp2
-rw-r--r--lldb/source/Target/TargetList.cpp2
7 files changed, 15 insertions, 9 deletions
diff --git a/lldb/source/Host/common/FileSpec.cpp b/lldb/source/Host/common/FileSpec.cpp
index c3b6aa5e8ff..d988b7f4350 100644
--- a/lldb/source/Host/common/FileSpec.cpp
+++ b/lldb/source/Host/common/FileSpec.cpp
@@ -1484,7 +1484,7 @@ FileSpec::IsSourceImplementationFile () const
}
bool
-FileSpec::IsRelativeToCurrentWorkingDirectory () const
+FileSpec::IsRelative() const
{
const char *dir = m_directory.GetCString();
llvm::StringRef directory(dir ? dir : "");
@@ -1519,3 +1519,9 @@ FileSpec::IsRelativeToCurrentWorkingDirectory () const
}
return false;
}
+
+bool
+FileSpec::IsAbsolute() const
+{
+ return !FileSpec::IsRelative();
+}
diff --git a/lldb/source/Host/linux/HostInfoLinux.cpp b/lldb/source/Host/linux/HostInfoLinux.cpp
index 3666b5acf74..3a3023b1343 100644
--- a/lldb/source/Host/linux/HostInfoLinux.cpp
+++ b/lldb/source/Host/linux/HostInfoLinux.cpp
@@ -225,7 +225,7 @@ bool
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();
diff --git a/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp b/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp
index 997742d2517..ed749571692 100644
--- a/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp
+++ b/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp
@@ -215,7 +215,7 @@ PlatformAndroid::GetFile (const FileSpec& source,
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 @@ PlatformAndroid::PutFile (const FileSpec& source,
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);
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
index 2ca09746f21..48e11bd8008 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
@@ -519,14 +519,14 @@ DWARFDebugLine::ParseSupportFiles (const lldb::ModuleSP &module_sp,
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())
{
const 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;
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index 7ed2998c92b..6078d3a19a1 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -977,7 +977,7 @@ SymbolFileDWARF::ParseCompileUnit (DWARFCompileUnit* dwarf_cu, uint32_t cu_idx)
{
// 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.
diff --git a/lldb/source/Target/ProcessLaunchInfo.cpp b/lldb/source/Target/ProcessLaunchInfo.cpp
index ec1c3c6ee0b..30c5aee63ca 100644
--- a/lldb/source/Target/ProcessLaunchInfo.cpp
+++ b/lldb/source/Target/ProcessLaunchInfo.cpp
@@ -423,7 +423,7 @@ ProcessLaunchInfo::ConvertArgumentsForLaunchingInShell (Error &error,
// 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")
diff --git a/lldb/source/Target/TargetList.cpp b/lldb/source/Target/TargetList.cpp
index 70ccd0423d1..552e951496f 100644
--- a/lldb/source/Target/TargetList.cpp
+++ b/lldb/source/Target/TargetList.cpp
@@ -412,7 +412,7 @@ TargetList::CreateTargetInternal (Debugger &debugger,
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] == '/') ||
OpenPOWER on IntegriCloud