diff options
| author | Zachary Turner <zturner@google.com> | 2017-03-06 23:42:14 +0000 |
|---|---|---|
| committer | Zachary Turner <zturner@google.com> | 2017-03-06 23:42:14 +0000 |
| commit | 7f6a7a37521e3610be7242ccec7ca9a15c1c307a (patch) | |
| tree | e2b7f59e0254269500347dfbd067108d86ca70a0 /lldb/source/API | |
| parent | 15492af547112d272572994bfef2d560ce651d7b (diff) | |
| download | bcm5719-llvm-7f6a7a37521e3610be7242ccec7ca9a15c1c307a.tar.gz bcm5719-llvm-7f6a7a37521e3610be7242ccec7ca9a15c1c307a.zip | |
Remove FileSpec::ReadFileContents.
This functionality is subsumed by DataBufferLLVM, which is
also more efficient since it will try to mmap. However, we
don't yet support mmaping writable private sections, and in
some cases we were using ReadFileContents and then modifying
the buffer. To address that I've added a flag to the
DataBufferLLVM methods that allow you to map privately, which
disables the mmaping path entirely. Eventually we should teach
DataBufferLLVM to use mmap with writable private, but that is
orthogonal to this effort.
Differential Revision: https://reviews.llvm.org/D30622
llvm-svn: 297095
Diffstat (limited to 'lldb/source/API')
| -rw-r--r-- | lldb/source/API/SBSection.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lldb/source/API/SBSection.cpp b/lldb/source/API/SBSection.cpp index 2850ce1172b..9da5d170da9 100644 --- a/lldb/source/API/SBSection.cpp +++ b/lldb/source/API/SBSection.cpp @@ -14,6 +14,7 @@ #include "lldb/Core/Section.h" #include "lldb/Symbol/ObjectFile.h" #include "lldb/Utility/DataBuffer.h" +#include "lldb/Utility/DataBufferLLVM.h" #include "lldb/Utility/DataExtractor.h" #include "lldb/Utility/Log.h" #include "lldb/Utility/StreamString.h" @@ -165,8 +166,8 @@ SBData SBSection::GetSectionData(uint64_t offset, uint64_t size) { else file_size = 0; } - DataBufferSP data_buffer_sp( - objfile->GetFileSpec().ReadFileContents(file_offset, file_size)); + auto data_buffer_sp = DataBufferLLVM::CreateSliceFromPath( + objfile->GetFileSpec().GetPath(), file_size, file_offset); if (data_buffer_sp && data_buffer_sp->GetByteSize() > 0) { DataExtractorSP data_extractor_sp( new DataExtractor(data_buffer_sp, objfile->GetByteOrder(), |

