mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-25 13:05:04 +00:00

DynamicLoader::LoadBinaryWithUUIDAndAddress can create a Module based on the binary image in memory, which in some cases contains symbol names and can be genuinely useful. If we don't have a filename, it creates a name in the form `memory-image-0x...` with the header address. In practice, this is most useful with Darwin userland corefiles where the binary was stored in the corefile in whole, and we can't find a binary with the matching UUID. Using the binary out of the corefile memory in this case works well. But in other cases, akin to firmware debugging, we merely end up with an oddly named binary image and no symbols. Add a flag to control whether we will create these memory images and add them to the Target or not; only set it to true when working with a userland Mach-O image with the "all image infos" LC_NOTE for a userland corefile. Differential Revision: https://reviews.llvm.org/D157167