summaryrefslogtreecommitdiff
path: root/source/Host/common/Host.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Host/common/Host.cpp')
-rw-r--r--source/Host/common/Host.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/source/Host/common/Host.cpp b/source/Host/common/Host.cpp
index d2848254779e..62b936aadef1 100644
--- a/source/Host/common/Host.cpp
+++ b/source/Host/common/Host.cpp
@@ -45,14 +45,13 @@
#include <lwp.h>
#endif
-// C++ Includes
#include <csignal>
+#include "lldb/Host/FileSystem.h"
#include "lldb/Host/Host.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Host/HostProcess.h"
#include "lldb/Host/MonitoringProcessLauncher.h"
-#include "lldb/Host/Predicate.h"
#include "lldb/Host/ProcessLauncher.h"
#include "lldb/Host/ThreadLauncher.h"
#include "lldb/Host/posix/ConnectionFileDescriptorPosix.h"
@@ -62,6 +61,7 @@
#include "lldb/Utility/DataBufferLLVM.h"
#include "lldb/Utility/FileSpec.h"
#include "lldb/Utility/Log.h"
+#include "lldb/Utility/Predicate.h"
#include "lldb/Utility/Status.h"
#include "lldb/lldb-private-forward.h"
#include "llvm/ADT/SmallString.h"
@@ -419,8 +419,10 @@ FileSpec Host::GetModuleFileSpecForHostAddress(const void *host_addr) {
#if !defined(__ANDROID__)
Dl_info info;
if (::dladdr(host_addr, &info)) {
- if (info.dli_fname)
- module_filespec.SetFile(info.dli_fname, true, FileSpec::Style::native);
+ if (info.dli_fname) {
+ module_filespec.SetFile(info.dli_fname, FileSpec::Style::native);
+ FileSystem::Instance().Resolve(module_filespec);
+ }
}
#endif
return module_filespec;
@@ -494,7 +496,7 @@ Status Host::RunShellCommand(const Args &args, const FileSpec &working_dir,
if (working_dir)
launch_info.SetWorkingDirectory(working_dir);
- llvm::SmallString<PATH_MAX> output_file_path;
+ llvm::SmallString<64> output_file_path;
if (command_output_ptr) {
// Create a temporary file to get the stdout/stderr and redirect the output
@@ -510,7 +512,7 @@ Status Host::RunShellCommand(const Args &args, const FileSpec &working_dir,
}
}
- FileSpec output_file_spec{output_file_path.c_str(), false};
+ FileSpec output_file_spec(output_file_path.c_str());
launch_info.AppendSuppressFileAction(STDIN_FILENO, true, false);
if (output_file_spec) {
@@ -554,14 +556,15 @@ Status Host::RunShellCommand(const Args &args, const FileSpec &working_dir,
if (command_output_ptr) {
command_output_ptr->clear();
- uint64_t file_size = output_file_spec.GetByteSize();
+ uint64_t file_size =
+ FileSystem::Instance().GetByteSize(output_file_spec);
if (file_size > 0) {
if (file_size > command_output_ptr->max_size()) {
error.SetErrorStringWithFormat(
"shell command output is too large to fit into a std::string");
} else {
auto Buffer =
- DataBufferLLVM::CreateFromPath(output_file_spec.GetPath());
+ FileSystem::Instance().CreateDataBuffer(output_file_spec);
if (error.Success())
command_output_ptr->assign(Buffer->GetChars(),
Buffer->GetByteSize());