summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2018-06-13 22:08:14 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2018-06-13 22:08:14 +0000
commit937348cd1359b30359b958ca81b7e7d8711b443e (patch)
treef4249e96df7ff194b336fdbf8cbd6c690d5a39f2 /lldb/source/Plugins
parent07570f55e4ad104a474efff4ae1a3c3b49145fed (diff)
downloadbcm5719-llvm-937348cd1359b30359b958ca81b7e7d8711b443e.tar.gz
bcm5719-llvm-937348cd1359b30359b958ca81b7e7d8711b443e.zip
[FileSpec] Make style argument mandatory for SetFile. NFC
SetFile has an optional style argument which defaulted to the native style. This patch makes that argument mandatory so clients of the FileSpec class are forced to think about the correct syntax. At the same time this introduces a (protected) convenience method to update the file from within the FileSpec class that keeps the current style. These two changes together prevent a potential pitfall where the style might be forgotten, leading to the path being updated and the style unintentionally being changed to the host style. llvm-svn: 334663
Diffstat (limited to 'lldb/source/Plugins')
-rw-r--r--lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp2
-rw-r--r--lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp3
-rw-r--r--lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp5
-rw-r--r--lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp4
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/ClangHost.cpp6
-rw-r--r--lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp2
-rw-r--r--lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp4
-rw-r--r--lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp4
-rw-r--r--lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp4
-rw-r--r--lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp5
-rw-r--r--lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp4
-rw-r--r--lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp4
-rw-r--r--lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp8
-rw-r--r--lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp4
-rw-r--r--lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp3
-rw-r--r--lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp3
-rw-r--r--lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp3
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp3
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp3
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp6
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp9
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp4
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp11
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp2
24 files changed, 61 insertions, 45 deletions
diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
index e02d6920b21..fbf255a3c0d 100644
--- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -637,7 +637,7 @@ bool DynamicLoaderDarwinKernel::KextImageInfo::ReadMemoryModule(
return false;
FileSpec file_spec;
- file_spec.SetFile(m_name.c_str(), false);
+ file_spec.SetFile(m_name.c_str(), false, FileSpec::Style::native);
ModuleSP memory_module_sp =
process->ReadModuleFromMemory(file_spec, m_load_address);
diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
index 3a43751398d..96242fd958d 100644
--- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
+++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
@@ -374,7 +374,8 @@ bool DynamicLoaderDarwin::JSONImageInformationIntoImageInfo(
image_infos[i].mod_date =
image->GetValueForKey("mod_date")->GetAsInteger()->GetValue();
image_infos[i].file_spec.SetFile(
- image->GetValueForKey("pathname")->GetAsString()->GetValue(), false);
+ image->GetValueForKey("pathname")->GetAsString()->GetValue(), false,
+ FileSpec::Style::native);
StructuredData::Dictionary *mh =
image->GetValueForKey("mach_header")->GetAsDictionary();
diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
index 6cabbef0a25..864ad7dea70 100644
--- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
+++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
@@ -693,7 +693,8 @@ bool DynamicLoaderMacOSXDYLD::ReadImageInfos(
// don't resolve the path
if (error.Success()) {
const bool resolve_path = false;
- image_infos[i].file_spec.SetFile(raw_path, resolve_path);
+ image_infos[i].file_spec.SetFile(raw_path, resolve_path,
+ FileSpec::Style::native);
}
}
return true;
@@ -892,7 +893,7 @@ uint32_t DynamicLoaderMacOSXDYLD::ParseLoadCommands(const DataExtractor &data,
const lldb::offset_t name_offset =
load_cmd_offset + data.GetU32(&offset);
const char *path = data.PeekCStr(name_offset);
- lc_id_dylinker->SetFile(path, true);
+ lc_id_dylinker->SetFile(path, true, FileSpec::Style::native);
}
break;
diff --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
index effef9e3eb8..68df4335c9e 100644
--- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
+++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
@@ -243,7 +243,7 @@ bool DYLDRendezvous::FillSOEntryFromModuleInfo(
entry.base_addr = base_addr;
entry.dyn_addr = dyn_addr;
- entry.file_spec.SetFile(name, false);
+ entry.file_spec.SetFile(name, false, FileSpec::Style::native);
UpdateBaseAddrIfNecessary(entry, name);
@@ -518,7 +518,7 @@ bool DYLDRendezvous::ReadSOEntryFromMemory(lldb::addr_t addr, SOEntry &entry) {
return false;
std::string file_path = ReadStringFromMemory(entry.path_addr);
- entry.file_spec.SetFile(file_path, false);
+ entry.file_spec.SetFile(file_path, false, FileSpec::Style::native);
UpdateBaseAddrIfNecessary(entry, file_path);
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangHost.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangHost.cpp
index ffc5120dc41..c3599859732 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangHost.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangHost.cpp
@@ -84,7 +84,7 @@ bool lldb_private::ComputeClangDirectory(FileSpec &lldb_shlib_spec,
"Developer/Toolchains/XcodeDefault.xctoolchain",
swift_clang_resource_dir);
if (!verify || VerifyClangPath(clang_path)) {
- file_spec.SetFile(clang_path.c_str(), true);
+ file_spec.SetFile(clang_path.c_str(), true, FileSpec::Style::native);
return true;
}
} else if (parent != r_end && *parent == "PrivateFrameworks" &&
@@ -98,7 +98,7 @@ bool lldb_private::ComputeClangDirectory(FileSpec &lldb_shlib_spec,
raw_path.resize(parent - r_end);
llvm::sys::path::append(clang_path, raw_path, swift_clang_resource_dir);
if (!verify || VerifyClangPath(clang_path)) {
- file_spec.SetFile(clang_path.c_str(), true);
+ file_spec.SetFile(clang_path.c_str(), true, FileSpec::Style::native);
return true;
}
raw_path = lldb_shlib_spec.GetPath();
@@ -110,7 +110,7 @@ bool lldb_private::ComputeClangDirectory(FileSpec &lldb_shlib_spec,
// Fall back to the Clang resource directory inside the framework.
raw_path.append("LLDB.framework/Resources/Clang");
- file_spec.SetFile(raw_path.c_str(), true);
+ file_spec.SetFile(raw_path.c_str(), true, FileSpec::Style::native);
return true;
}
diff --git a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
index 62e08830b35..4eb15369aa1 100644
--- a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
@@ -4650,7 +4650,7 @@ public:
switch (short_option) {
case 'f':
- m_outfile.SetFile(option_arg, true);
+ m_outfile.SetFile(option_arg, true, FileSpec::Style::native);
if (m_outfile.Exists()) {
m_outfile.Clear();
err.SetErrorStringWithFormat("file already exists: '%s'",
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index d7ca32427aa..ce62077f125 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -4005,8 +4005,8 @@ size_t ObjectFileMachO::ParseSymtab() {
// that looks like "/tmp/src//tmp/src/"
FileSpec so_dir(so_path, false);
if (!so_dir.Exists()) {
- so_dir.SetFile(&full_so_path[double_slash_pos + 1],
- false);
+ so_dir.SetFile(&full_so_path[double_slash_pos + 1], false,
+ FileSpec::Style::native);
if (so_dir.Exists()) {
// Trim off the incorrect path
full_so_path.erase(0, double_slash_pos + 1);
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp
index 2fcd22b0d41..e55cc0f4f6a 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp
@@ -315,12 +315,12 @@ Status PlatformAppleTVSimulator::GetSymbolFile(const FileSpec &platform_file,
platform_file_path);
// First try in the SDK and see if the file is in there
- local_file.SetFile(resolved_path, true);
+ local_file.SetFile(resolved_path, true, FileSpec::Style::native);
if (local_file.Exists())
return error;
// Else fall back to the actual path itself
- local_file.SetFile(platform_file_path, true);
+ local_file.SetFile(platform_file_path, true, FileSpec::Style::native);
if (local_file.Exists())
return error;
}
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp
index 39bd2dc377d..8bbe0af0aec 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp
@@ -315,12 +315,12 @@ Status PlatformAppleWatchSimulator::GetSymbolFile(const FileSpec &platform_file,
platform_file_path);
// First try in the SDK and see if the file is in there
- local_file.SetFile(resolved_path, true);
+ local_file.SetFile(resolved_path, true, FileSpec::Style::native);
if (local_file.Exists())
return error;
// Else fall back to the actual path itself
- local_file.SetFile(platform_file_path, true);
+ local_file.SetFile(platform_file_path, true, FileSpec::Style::native);
if (local_file.Exists())
return error;
}
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
index fa4a16b7671..9e2b721b67f 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
@@ -1167,7 +1167,7 @@ const char *PlatformDarwin::GetDeveloperDirectory() {
if (xcode_select_prefix_dir)
xcode_dir_path.append(xcode_select_prefix_dir);
xcode_dir_path.append("/usr/share/xcode-select/xcode_dir_path");
- temp_file_spec.SetFile(xcode_dir_path, false);
+ temp_file_spec.SetFile(xcode_dir_path, false, FileSpec::Style::native);
auto dir_buffer =
DataBufferLLVM::CreateFromPath(temp_file_spec.GetPath());
if (dir_buffer && dir_buffer->GetByteSize() > 0) {
@@ -1215,7 +1215,8 @@ const char *PlatformDarwin::GetDeveloperDirectory() {
}
if (developer_dir_path_valid) {
- temp_file_spec.SetFile(developer_dir_path, false);
+ temp_file_spec.SetFile(developer_dir_path, false,
+ FileSpec::Style::native);
if (temp_file_spec.Exists()) {
m_developer_directory.assign(developer_dir_path);
return m_developer_directory.c_str();
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
index 9aa7995e553..6b938a584cc 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
@@ -623,7 +623,7 @@ bool PlatformDarwinKernel::KextHasdSYMSibling(
kext_bundle_filepath.GetPath() + "/Contents/MacOS/";
deep_bundle_str += executable_name.AsCString();
deep_bundle_str += ".dSYM";
- dsym_fspec.SetFile(deep_bundle_str, true);
+ dsym_fspec.SetFile(deep_bundle_str, true, FileSpec::Style::native);
if (llvm::sys::fs::is_directory(dsym_fspec.GetPath())) {
return true;
}
@@ -633,7 +633,7 @@ bool PlatformDarwinKernel::KextHasdSYMSibling(
std::string shallow_bundle_str = kext_bundle_filepath.GetPath() + "/";
shallow_bundle_str += executable_name.AsCString();
shallow_bundle_str += ".dSYM";
- dsym_fspec.SetFile(shallow_bundle_str, true);
+ dsym_fspec.SetFile(shallow_bundle_str, true, FileSpec::Style::native);
if (llvm::sys::fs::is_directory(dsym_fspec.GetPath())) {
return true;
}
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
index 50b5988b48a..c24a0ee2a82 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
@@ -217,13 +217,13 @@ ConstString PlatformMacOSX::GetSDKDirectory(lldb_private::Target &target) {
"SDKs/MacOSX%u.%u.sdk",
xcode_contents_path.c_str(), versions[0],
versions[1]);
- fspec.SetFile(sdk_path.GetString(), false);
+ fspec.SetFile(sdk_path.GetString(), false, FileSpec::Style::native);
if (fspec.Exists())
return ConstString(sdk_path.GetString());
}
if (!default_xcode_sdk.empty()) {
- fspec.SetFile(default_xcode_sdk, false);
+ fspec.SetFile(default_xcode_sdk, false, FileSpec::Style::native);
if (fspec.Exists())
return ConstString(default_xcode_sdk);
}
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp
index 01a4c8858c7..7b78c674c26 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp
@@ -409,7 +409,7 @@ bool PlatformRemoteDarwinDevice::GetFileInSDK(const char *platform_file_path,
const char *paths_to_try[] = {"Symbols", "", "Symbols.Internal", nullptr};
for (size_t i = 0; paths_to_try[i] != nullptr; i++) {
- local_file.SetFile(sdkroot_path, false);
+ local_file.SetFile(sdkroot_path, false, FileSpec::Style::native);
if (paths_to_try[i][0] != '\0')
local_file.AppendPathComponent(paths_to_try[i]);
local_file.AppendPathComponent(platform_file_path);
@@ -442,7 +442,7 @@ Status PlatformRemoteDarwinDevice::GetSymbolFile(const FileSpec &platform_file,
::snprintf(resolved_path, sizeof(resolved_path), "%s/%s", os_version_dir,
platform_file_path);
- local_file.SetFile(resolved_path, true);
+ local_file.SetFile(resolved_path, true, FileSpec::Style::native);
if (local_file.Exists()) {
if (log) {
log->Printf("Found a copy of %s in the DeviceSupport dir %s",
@@ -454,7 +454,7 @@ Status PlatformRemoteDarwinDevice::GetSymbolFile(const FileSpec &platform_file,
::snprintf(resolved_path, sizeof(resolved_path), "%s/Symbols.Internal/%s",
os_version_dir, platform_file_path);
- local_file.SetFile(resolved_path, true);
+ local_file.SetFile(resolved_path, true, FileSpec::Style::native);
if (local_file.Exists()) {
if (log) {
log->Printf(
@@ -466,7 +466,7 @@ Status PlatformRemoteDarwinDevice::GetSymbolFile(const FileSpec &platform_file,
::snprintf(resolved_path, sizeof(resolved_path), "%s/Symbols/%s",
os_version_dir, platform_file_path);
- local_file.SetFile(resolved_path, true);
+ local_file.SetFile(resolved_path, true, FileSpec::Style::native);
if (local_file.Exists()) {
if (log) {
log->Printf("Found a copy of %s in the DeviceSupport dir %s/Symbols",
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp
index 9cd294455e2..26feec28232 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp
@@ -320,12 +320,12 @@ Status PlatformiOSSimulator::GetSymbolFile(const FileSpec &platform_file,
platform_file_path);
// First try in the SDK and see if the file is in there
- local_file.SetFile(resolved_path, true);
+ local_file.SetFile(resolved_path, true, FileSpec::Style::native);
if (local_file.Exists())
return error;
// Else fall back to the actual path itself
- local_file.SetFile(platform_file_path, true);
+ local_file.SetFile(platform_file_path, true, FileSpec::Style::native);
if (local_file.Exists())
return error;
}
diff --git a/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp b/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
index eeff8f3518a..d3f43399a0e 100644
--- a/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
+++ b/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
@@ -130,7 +130,8 @@ PlatformPOSIX::ResolveExecutable(const ModuleSpec &module_spec,
// on the current path variables
if (!resolved_module_spec.GetFileSpec().Exists()) {
resolved_module_spec.GetFileSpec().GetPath(exe_path, sizeof(exe_path));
- resolved_module_spec.GetFileSpec().SetFile(exe_path, true);
+ resolved_module_spec.GetFileSpec().SetFile(exe_path, true,
+ FileSpec::Style::native);
}
if (!resolved_module_spec.GetFileSpec().Exists())
diff --git a/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp b/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp
index fdbcd37baea..5501710a235 100644
--- a/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp
+++ b/lldb/source/Plugins/Platform/Windows/PlatformWindows.cpp
@@ -194,7 +194,8 @@ Status PlatformWindows::ResolveExecutable(
// variables
if (!resolved_module_spec.GetFileSpec().Exists()) {
resolved_module_spec.GetFileSpec().GetPath(exe_path, sizeof(exe_path));
- resolved_module_spec.GetFileSpec().SetFile(exe_path, true);
+ resolved_module_spec.GetFileSpec().SetFile(exe_path, true,
+ FileSpec::Style::native);
}
if (!resolved_module_spec.GetFileSpec().Exists())
diff --git a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
index e68025bea79..7bb7b72eaac 100644
--- a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
+++ b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
@@ -249,7 +249,8 @@ Status ProcessElfCore::DoLoadCore() {
ModuleSpec exe_module_spec;
exe_module_spec.GetArchitecture() = arch;
exe_module_spec.GetFileSpec().SetFile(
- m_nt_file_entries[0].path.GetCString(), false);
+ m_nt_file_entries[0].path.GetCString(), false,
+ FileSpec::Style::native);
if (exe_module_spec.GetFileSpec()) {
exe_module_sp = GetTarget().GetSharedModule(exe_module_spec);
if (exe_module_sp)
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
index eb8ce5af42a..14f05531479 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
@@ -997,7 +997,8 @@ Status GDBRemoteCommunication::StartDebugserverProcess(
// debugserver to use and use it if we do.
const char *env_debugserver_path = getenv("LLDB_DEBUGSERVER_PATH");
if (env_debugserver_path) {
- debugserver_file_spec.SetFile(env_debugserver_path, false);
+ debugserver_file_spec.SetFile(env_debugserver_path, false,
+ FileSpec::Style::native);
if (log)
log->Printf("GDBRemoteCommunication::%s() gdb-remote stub exe path set "
"from environment variable: %s",
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
index 844e248dd0a..6948339c676 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -1939,7 +1939,8 @@ bool GDBRemoteCommunicationClient::DecodeProcessInfoResponse(
// characters in a process name
std::string name;
extractor.GetHexByteString(name);
- process_info.GetExecutableFile().SetFile(name, false);
+ process_info.GetExecutableFile().SetFile(name, false,
+ FileSpec::Style::native);
} else if (name.equals("cputype")) {
value.getAsInteger(0, cpu);
} else if (name.equals("cpusubtype")) {
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
index c73fc56119c..d0cdbf3e292 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
@@ -361,7 +361,8 @@ GDBRemoteCommunicationServerCommon::Handle_qfProcessInfo(
StringExtractor extractor(value);
std::string file;
extractor.GetHexByteString(file);
- match_info.GetProcessInfo().GetExecutableFile().SetFile(file, false);
+ match_info.GetProcessInfo().GetExecutableFile().SetFile(
+ file, false, FileSpec::Style::native);
} else if (key.equals("name_match")) {
NameMatch name_match = llvm::StringSwitch<NameMatch>(value)
.Case("equals", NameMatch::Equals)
@@ -1031,7 +1032,8 @@ GDBRemoteCommunicationServerCommon::Handle_A(StringExtractorGDBRemote &packet) {
if (success) {
if (arg_idx == 0)
- m_process_launch_info.GetExecutableFile().SetFile(arg, false);
+ m_process_launch_info.GetExecutableFile().SetFile(
+ arg, false, FileSpec::Style::native);
m_process_launch_info.GetArguments().AppendArgument(arg);
if (log)
log->Printf("LLGSPacketHandler::%s added arg %d: \"%s\"",
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index b3338f3b4b7..e65f2f3e3b1 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -824,11 +824,14 @@ Status ProcessGDBRemote::DoLaunch(Module *exe_module,
if (disable_stdio) {
// set to /dev/null unless redirected to a file above
if (!stdin_file_spec)
- stdin_file_spec.SetFile(FileSystem::DEV_NULL, false);
+ stdin_file_spec.SetFile(FileSystem::DEV_NULL, false,
+ FileSpec::Style::native);
if (!stdout_file_spec)
- stdout_file_spec.SetFile(FileSystem::DEV_NULL, false);
+ stdout_file_spec.SetFile(FileSystem::DEV_NULL, false,
+ FileSpec::Style::native);
if (!stderr_file_spec)
- stderr_file_spec.SetFile(FileSystem::DEV_NULL, false);
+ stderr_file_spec.SetFile(FileSystem::DEV_NULL, false,
+ FileSpec::Style::native);
} else if (platform_sp && platform_sp->IsHost()) {
// If the debugserver is local and we aren't disabling STDIO, lets use
// a pseudo terminal to instead of relying on the 'O' packets for stdio
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
index 1f66d8a23d8..317ea4c22c6 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
@@ -463,7 +463,7 @@ bool DWARFDebugLine::ParseSupportFiles(
for (uint32_t file_idx = 1;
prologue.GetFile(file_idx, cu_comp_dir, file_spec); ++file_idx) {
if (module_sp->RemapSourceFile(file_spec.GetPath(), remapped_file))
- file_spec.SetFile(remapped_file, false);
+ file_spec.SetFile(remapped_file, false, FileSpec::Style::native);
support_files.Append(file_spec);
}
return true;
@@ -866,7 +866,7 @@ bool DWARFDebugLine::Prologue::GetFile(uint32_t file_idx,
const lldb_private::FileSpec &comp_dir, FileSpec &file) const {
uint32_t idx = file_idx - 1; // File indexes are 1 based...
if (idx < file_names.size()) {
- file.SetFile(file_names[idx].name, false);
+ file.SetFile(file_names[idx].name, false, FileSpec::Style::native);
if (file.IsRelative()) {
if (file_names[idx].dir_idx > 0) {
const uint32_t dir_idx = file_names[idx].dir_idx - 1;
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index 203c22ee8b1..ac320ac52b0 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -801,7 +801,8 @@ lldb::CompUnitSP SymbolFileDWARF::ParseCompileUnit(DWARFUnit *dwarf_cu,
std::string remapped_file;
if (module_sp->RemapSourceFile(cu_file_spec.GetPath(),
remapped_file))
- cu_file_spec.SetFile(remapped_file, false);
+ cu_file_spec.SetFile(remapped_file, false,
+ FileSpec::Style::native);
}
LanguageType cu_language = DWARFUnit::LanguageTypeFromDWARF(
@@ -1584,7 +1585,7 @@ SymbolFileDWARF::GetDwoSymbolFileForCompileUnit(
if (!comp_dir)
return nullptr;
- dwo_file.SetFile(comp_dir, true);
+ dwo_file.SetFile(comp_dir, true, FileSpec::Style::native);
dwo_file.AppendPathComponent(dwo_name);
}
@@ -1627,12 +1628,14 @@ void SymbolFileDWARF::UpdateExternalModuleListIfNeeded() {
die.GetAttributeValueAsString(DW_AT_GNU_dwo_name, nullptr);
if (dwo_path) {
ModuleSpec dwo_module_spec;
- dwo_module_spec.GetFileSpec().SetFile(dwo_path, false);
+ dwo_module_spec.GetFileSpec().SetFile(dwo_path, false,
+ FileSpec::Style::native);
if (dwo_module_spec.GetFileSpec().IsRelative()) {
const char *comp_dir =
die.GetAttributeValueAsString(DW_AT_comp_dir, nullptr);
if (comp_dir) {
- dwo_module_spec.GetFileSpec().SetFile(comp_dir, true);
+ dwo_module_spec.GetFileSpec().SetFile(comp_dir, true,
+ FileSpec::Style::native);
dwo_module_spec.GetFileSpec().AppendPathComponent(dwo_path);
}
}
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
index d25e2c61200..39c70d14652 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
@@ -351,7 +351,7 @@ void SymbolFileDWARFDebugMap::InitOSO() {
so_symbol->GetType() == eSymbolTypeSourceFile &&
oso_symbol->GetType() == eSymbolTypeObjectFile) {
m_compile_unit_infos[i].so_file.SetFile(
- so_symbol->GetName().AsCString(), false);
+ so_symbol->GetName().AsCString(), false, FileSpec::Style::native);
m_compile_unit_infos[i].oso_path = oso_symbol->GetName();
m_compile_unit_infos[i].oso_mod_time =
llvm::sys::toTimePoint(oso_symbol->GetIntegerValue(0));
OpenPOWER on IntegriCloud