diff options
author | Pavel Labath <labath@google.com> | 2017-12-21 10:54:30 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2017-12-21 10:54:30 +0000 |
commit | 50251fc7159a71c84f6fcd65a115c67e5a271b85 (patch) | |
tree | 866766fbba3d96717e2bc7580849e528c4da037f /lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp | |
parent | 4e945b6d05ffa04f948c36eafc5508e1079cad19 (diff) | |
download | bcm5719-llvm-50251fc7159a71c84f6fcd65a115c67e5a271b85.tar.gz bcm5719-llvm-50251fc7159a71c84f6fcd65a115c67e5a271b85.zip |
Make sure DataBufferLLVM contents are writable
Summary:
We sometimes need to write to the object file we've mapped into memory,
generally to apply relocations to debug info sections. We've had that
ability before, but with the introduction of DataBufferLLVM, we have
lost it, as the underlying llvm class (MemoryBuffer) only supports
read-only mappings.
This switches DataBufferLLVM to use the new llvm::WritableMemoryBuffer
class as a back-end, as this one guarantees to return a writable buffer.
This removes the need for the "Private" flag to the DataBufferLLVM
creation functions, as it was really used to mean "writable". The LLVM
function also does not have the NullTerminate flag, so I've modified our
clients to not require this feature and removed that flag as well.
Reviewers: zturner, clayborg, jingham
Subscribers: emaste, aprantl, arichardson, krytarowski, lldb-commits
Differential Revision: https://reviews.llvm.org/D40079
llvm-svn: 321255
Diffstat (limited to 'lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp')
-rw-r--r-- | lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp index b39aa103f1d..b04d72f755f 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp @@ -1173,7 +1173,7 @@ const char *PlatformDarwin::GetDeveloperDirectory() { xcode_dir_path.append("/usr/share/xcode-select/xcode_dir_path"); temp_file_spec.SetFile(xcode_dir_path, false); auto dir_buffer = - DataBufferLLVM::CreateFromPath(temp_file_spec.GetPath(), true); + DataBufferLLVM::CreateFromPath(temp_file_spec.GetPath()); if (dir_buffer && dir_buffer->GetByteSize() > 0) { llvm::StringRef path_ref(dir_buffer->GetChars()); // Trim tailing newlines and make sure there is enough room for a null |