diff options
Diffstat (limited to 'contrib/llvm/tools/lldb/source/Interpreter/OptionValueFileSpec.cpp')
-rw-r--r-- | contrib/llvm/tools/lldb/source/Interpreter/OptionValueFileSpec.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/contrib/llvm/tools/lldb/source/Interpreter/OptionValueFileSpec.cpp b/contrib/llvm/tools/lldb/source/Interpreter/OptionValueFileSpec.cpp index a6eb537..b235d4a 100644 --- a/contrib/llvm/tools/lldb/source/Interpreter/OptionValueFileSpec.cpp +++ b/contrib/llvm/tools/lldb/source/Interpreter/OptionValueFileSpec.cpp @@ -15,6 +15,7 @@ #include "lldb/Interpreter/Args.h" #include "lldb/Interpreter/CommandCompletions.h" #include "lldb/Interpreter/CommandInterpreter.h" +#include "lldb/Utility/DataBufferLLVM.h" using namespace lldb; using namespace lldb_private; @@ -53,9 +54,9 @@ void OptionValueFileSpec::DumpValue(const ExecutionContext *exe_ctx, } } -Error OptionValueFileSpec::SetValueFromString(llvm::StringRef value, - VarSetOperationType op) { - Error error; +Status OptionValueFileSpec::SetValueFromString(llvm::StringRef value, + VarSetOperationType op) { + Status error; switch (op) { case eVarSetOperationClear: Clear(); @@ -118,10 +119,8 @@ OptionValueFileSpec::GetFileContents(bool null_terminate) { const auto file_mod_time = FileSystem::GetModificationTime(m_current_value); if (m_data_sp && m_data_mod_time == file_mod_time) return m_data_sp; - if (null_terminate) - m_data_sp = m_current_value.ReadFileContentsAsCString(); - else - m_data_sp = m_current_value.ReadFileContents(); + m_data_sp = DataBufferLLVM::CreateFromPath(m_current_value.GetPath(), + null_terminate); m_data_mod_time = file_mod_time; } return m_data_sp; |