llvm-project/lldb/source/DataFormatters
Jonas Devlieghere fc54427e76
[lldb] Refactor DataBuffer so we can map files as read-only
Currently, all data buffers are assumed to be writable. This is a
problem on macOS where it's not allowed to load unsigned binaries in
memory as writable. To be more precise, MAP_RESILIENT_CODESIGN and
MAP_RESILIENT_MEDIA need to be set for mapped (unsigned) binaries on our
platform.

Binaries are mapped through FileSystem::CreateDataBuffer which returns a
DataBufferLLVM. The latter is backed by a llvm::WritableMemoryBuffer
because every DataBuffer in LLDB is considered to be writable. In order
to use a read-only llvm::MemoryBuffer I had to split our abstraction
around it.

This patch distinguishes between a DataBuffer (read-only) and
WritableDataBuffer (read-write) and updates LLDB to use the appropriate
one.

rdar://74890607

Differential revision: https://reviews.llvm.org/D122856
2022-04-05 13:46:37 -07:00
..
CMakeLists.txt
CXXFunctionPointer.cpp Set a default number of address bits on Darwin arm64 systems 2021-12-09 22:53:01 -08:00
DataVisualization.cpp [lldb][NFC] Remove FormatMap 2020-07-23 18:34:59 +02:00
DumpValueObjectOptions.cpp
FormatCache.cpp [lldb][NFC] Always update m_cache_{hits/misses} in FormatCache 2020-03-24 20:16:43 +01:00
FormatClasses.cpp
FormatManager.cpp [lldb] Remove usages of case-insensitive c-string functions 2022-03-29 17:59:17 +02:00
FormattersHelpers.cpp [lldb] (Partially) enable formatting of utf strings before the program is started 2021-11-18 14:45:17 +01:00
LanguageCategory.cpp
StringPrinter.cpp [lldb] Refactor DataBuffer so we can map files as read-only 2022-04-05 13:46:37 -07:00
TypeCategory.cpp [lldb] Remove FormattersContainer's name member 2020-07-21 13:54:38 +02:00
TypeCategoryMap.cpp [lldb] Rename Logging.h to LLDBLog.h and clean up includes 2022-02-03 14:47:01 +01:00
TypeFormat.cpp [lldb] Refactor DataBuffer so we can map files as read-only 2022-04-05 13:46:37 -07:00
TypeSummary.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
TypeSynthetic.cpp [lldb] Replace default bodies of special member functions with = default; 2021-07-02 11:31:16 -07:00
ValueObjectPrinter.cpp [lldb/DataFormatters] Display null C++ pointers as nullptr 2020-11-12 15:24:06 -08:00
VectorType.cpp [LLDB] Applying clang-tidy modernize-use-default-member-init over LLDB 2022-03-14 13:32:03 -07:00