forked from OSchip/llvm-project
[Windows] Fix Windows build after be053dd5a384a03da5a77552686900ddc7bfc178
llvm-svn: 345956
This commit is contained in:
parent
8a3ef6f3c3
commit
54bb316185
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue