[Lldb-commits] [PATCH] D40079: Make sure DataBufferLLVM contents are writable

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Wed Nov 15 10:39:25 PST 2017


On 15 November 2017 at 18:11, Zachary Turner <zturner at google.com> wrote:
>
>
> On Wed, Nov 15, 2017 at 9:51 AM Pavel Labath <labath at google.com> wrote:
>>
>> On 15 November 2017 at 17:42, Zachary Turner <zturner at google.com> wrote:
>> > Can we just extend llvm's mapped_file_region to support a boolean
>> > Writable
>> > flag?
>> >
>> mapped_file_region already can be writable. The feature it is missing
>> is the ability to *not* use mmap. And that's not a good idea, as the
>> whole purpose of that class is to mmap things.
>
>
>>
>> We could theoretically add a writable flag to llvm::MemoryBuffer,
>> but's its header says:
>> /// This interface provides simple ***read-only*** access to a block
>> of memory, and ...
>
>
> To be quite honest I've been annoyed by MemoryBuffer's lack of mutability on
> many different occasions.  It's something I've wanted to fix for a long time
> anyway.
>
> If this patch isn't super time-critical, I can actually volunteer to go make
> a writable version of MemoryBuffer, and then we can use that instead.  I
> could probably be done in a day or two.  Thoughts?

I'd like to fix this soon-ish, but it can wait a couple of days. I
look forward to seeing the result.


More information about the lldb-commits mailing list