[Lldb-commits] [PATCH] D30054: Delete DataBufferMemoryMap

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 23 05:16:39 PST 2017


labath added a comment.

I've tried this out on linux. I got it working only after making the following modifications:



================
Comment at: lldb/include/lldb/Core/DataBufferLLVM.h:15
+#include "lldb/Host/FileSpec.h"
+#include "llvm/Support/MemoryBuffer.h"
+
----------------
add `#include "llvm/Support/FileSystem.h"`


================
Comment at: lldb/include/lldb/Core/DataBufferLLVM.h:38
+  static std::shared_ptr<DataBufferLLVM>
+  CreateFromFileSpec(const FileSpec &F, uint32_t Size, uint32_t Offset) {
+    return CreateFromPath(F.GetPath(), Size, Offset);
----------------
Change this to `uint64_t Size` so that passing -1 will correctly mean "auto-detect the file size".


================
Comment at: lldb/include/lldb/Core/DataBufferLLVM.h:43
+  uint8_t *GetBytes() override {
+    llvm_unreachable("Not implemented!");
+    return nullptr;
----------------
This makes pretty much everything fail. Most of the code base has a reference to a non-const DataBuffer, which then just segfaults after calling this. I think you'll have to return a const_cast of the buffer here for now.


https://reviews.llvm.org/D30054





More information about the lldb-commits mailing list