[Windows] Fix Windows build after be053dd5a384a03da5a77552686900ddc7bfc178
authorAleksandr Urakov <aleksandr.urakov@jetbrains.com>
Fri, 2 Nov 2018 08:47:33 +0000 (08:47 +0000)
committerAleksandr Urakov <aleksandr.urakov@jetbrains.com>
Fri, 2 Nov 2018 08:47:33 +0000 (08:47 +0000)
llvm-svn: 345956

lldb/source/Host/windows/FileSystem.cpp
lldb/source/Host/windows/Host.cpp
lldb/source/Host/windows/HostInfoWindows.cpp
lldb/source/Host/windows/HostProcessWindows.cpp
lldb/source/Plugins/Process/Windows/Common/DebuggerThread.cpp
lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp

index 9309b89..3e9787d 100644 (file)
@@ -75,7 +75,7 @@ Status FileSystem::Readlink(const FileSpec &src, FileSpec &dst) {
   else if (!llvm::convertWideToUTF8(buf.data(), path))
     error.SetErrorString(PATH_CONVERSION_ERROR);
   else
-    dst.SetFile(path, false, FileSpec::Style::native);
+    dst.SetFile(path, FileSpec::Style::native);
 
   ::CloseHandle(h);
   return error;
index 452502d..a11a599 100644 (file)
@@ -84,7 +84,7 @@ void GetProcessExecutableAndTriple(const AutoHandle &handle,
   triple.setOS(llvm::Triple::Win32);
   triple.setArch(llvm::Triple::UnknownArch);
   if (GetExecutableForProcess(handle, executable)) {
-    FileSpec executableFile(executable.c_str(), false);
+    FileSpec executableFile(executable.c_str());
     process.SetExecutableFile(executableFile, true);
     GetTripleForProcess(executableFile, triple);
   }
@@ -123,7 +123,7 @@ FileSpec Host::GetModuleFileSpecForHostAddress(const void *host_addr) {
   std::string path;
   if (!llvm::convertWideToUTF8(buffer.data(), path))
     return module_filespec;
-  module_filespec.SetFile(path, false, FileSpec::Style::native);
+  module_filespec.SetFile(path, FileSpec::Style::native);
   return module_filespec;
 }
 
@@ -146,7 +146,7 @@ uint32_t Host::FindProcesses(const ProcessInstanceInfoMatch &match_info,
       ProcessInstanceInfo process;
       std::string exeFile;
       llvm::convertWideToUTF8(pe.szExeFile, exeFile);
-      process.SetExecutableFile(FileSpec(exeFile, false), true);
+      process.SetExecutableFile(FileSpec(exeFile), true);
       process.SetProcessID(pe.th32ProcessID);
       process.SetParentProcessID(pe.th32ParentProcessID);
       GetProcessExecutableAndTriple(handle, process);
index bd3f74f..2fde54b 100644 (file)
@@ -92,7 +92,7 @@ FileSpec HostInfoWindows::GetProgramFileSpec() {
     ::GetModuleFileNameW(NULL, buffer.data(), buffer.size());
     std::string path;
     llvm::convertWideToUTF8(buffer.data(), path);
-    m_program_filespec.SetFile(path, false, FileSpec::Style::native);
+    m_program_filespec.SetFile(path, FileSpec::Style::native);
   });
   return m_program_filespec;
 }
@@ -103,9 +103,9 @@ FileSpec HostInfoWindows::GetDefaultShell() {
 
   std::string shell;
   if (GetEnvironmentVar("ComSpec", shell))
-    return FileSpec(shell, false);
+    return FileSpec(shell);
 
-  return FileSpec("C:\\Windows\\system32\\cmd.exe", false);
+  return FileSpec("C:\\Windows\\system32\\cmd.exe");
 }
 
 bool HostInfoWindows::GetEnvironmentVar(const std::string &var_name,
index ce75c14..701167f 100644 (file)
@@ -57,7 +57,7 @@ Status HostProcessWindows::GetMainModule(FileSpec &file_spec) const {
   if (::GetProcessImageFileNameW(m_process, wpath.data(), wpath.size())) {
     std::string path;
     if (llvm::convertWideToUTF8(wpath.data(), path))
-      file_spec.SetFile(path, false, FileSpec::Style::native);
+      file_spec.SetFile(path, FileSpec::Style::native);
     else
       error.SetErrorString("Error converting path to UTF-8");
   } else
index 65a0f0e..81ec258 100644 (file)
@@ -470,7 +470,7 @@ DebuggerThread::HandleLoadDllEvent(const LOAD_DLL_DEBUG_INFO &info,
     if (path_str.startswith("\\\\?\\"))
       path += 4;
 
-    FileSpec file_spec(path, false);
+    FileSpec file_spec(path);
     ModuleSpec module_spec(file_spec);
     lldb::addr_t load_addr = reinterpret_cast<lldb::addr_t>(info.lpBaseOfDll);
 
index 93f4411..945b2eb 100644 (file)
@@ -252,11 +252,13 @@ Status ProcessWindows::DoLaunch(Module *exe_module,
 
   FileSpec working_dir = launch_info.GetWorkingDirectory();
   namespace fs = llvm::sys::fs;
-  if (working_dir && (!working_dir.ResolvePath() ||
-                      !fs::is_directory(working_dir.GetPath()))) {
-    result.SetErrorStringWithFormat("No such file or directory: %s",
-                                    working_dir.GetCString());
-    return result;
+  if (working_dir) {
+    FileSystem::Instance().Resolve(working_dir);
+    if (!fs::is_directory(working_dir.GetPath())) {
+      result.SetErrorStringWithFormat("No such file or directory: %s",
+                                      working_dir.GetCString());
+      return result;
+    }
   }
 
   if (!launch_info.GetFlags().Test(eLaunchFlagDebug)) {
@@ -904,7 +906,8 @@ void ProcessWindows::OnDebuggerConnected(lldb::addr_t image_base) {
       return;
     }
 
-    FileSpec executable_file(file_name, true);
+    FileSpec executable_file(file_name);
+    FileSystem::Instance().Resolve(executable_file);
     ModuleSpec module_spec(executable_file);
     Status error;
     module = GetTarget().GetSharedModule(module_spec, &error);