summaryrefslogtreecommitdiff
path: root/source/Plugins/ObjectFile/PECOFF
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-12-24 01:01:00 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-12-24 01:01:00 +0000
commit23629167fefb8117a4d2cc9213c8a29d5b4a1197 (patch)
treec410512ef1b5e0f0e81b7f333cafabc3ad716f5d /source/Plugins/ObjectFile/PECOFF
parentef5d0b5e97ec8e6fa395d377b09aa7755e345b4f (diff)
Notes
Diffstat (limited to 'source/Plugins/ObjectFile/PECOFF')
-rw-r--r--source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
index 72b1b15f08f86..77bfa7fe0a640 100644
--- a/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
+++ b/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
@@ -22,7 +22,6 @@
#include "lldb/Target/Target.h"
#include "lldb/Utility/ArchSpec.h"
#include "lldb/Utility/DataBufferHeap.h"
-#include "lldb/Utility/DataBufferLLVM.h"
#include "lldb/Utility/FileSpec.h"
#include "lldb/Utility/StreamString.h"
#include "lldb/Utility/Timer.h"
@@ -66,8 +65,7 @@ ObjectFile *ObjectFilePECOFF::CreateInstance(const lldb::ModuleSP &module_sp,
lldb::offset_t file_offset,
lldb::offset_t length) {
if (!data_sp) {
- data_sp =
- DataBufferLLVM::CreateSliceFromPath(file->GetPath(), length, file_offset);
+ data_sp = MapFileData(file, length, file_offset);
if (!data_sp)
return nullptr;
data_offset = 0;
@@ -78,8 +76,7 @@ ObjectFile *ObjectFilePECOFF::CreateInstance(const lldb::ModuleSP &module_sp,
// Update the data to contain the entire file if it doesn't already
if (data_sp->GetByteSize() < length) {
- data_sp =
- DataBufferLLVM::CreateSliceFromPath(file->GetPath(), length, file_offset);
+ data_sp = MapFileData(file, length, file_offset);
if (!data_sp)
return nullptr;
}
@@ -436,8 +433,7 @@ DataExtractor ObjectFilePECOFF::ReadImageData(uint32_t offset, size_t size) {
if (m_file) {
// A bit of a hack, but we intend to write to this buffer, so we can't
// mmap it.
- auto buffer_sp =
- DataBufferLLVM::CreateSliceFromPath(m_file.GetPath(), size, offset, true);
+ auto buffer_sp = MapFileData(m_file, size, offset);
return DataExtractor(buffer_sp, GetByteOrder(), GetAddressByteSize());
}
ProcessSP process_sp(m_process_wp.lock());