aprantl added a comment. Nice.
================ Comment at: lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm:533 if (dyld_process_create_for_current_task) { - auto dyld_process = dyld_process_create_for_current_task(); - auto snapshot = - dyld_process_snapshot_create_for_process(dyld_process, nullptr); - auto shared_cache = dyld_process_snapshot_get_shared_cache(snapshot); - assert(dyld_process && snapshot && shared_cache); - - dyld_shared_cache_for_each_image(shared_cache, ^(dyld_image_t image) { - __block uint64_t minVmAddr = UINT64_MAX; - __block uint64_t maxVmAddr = 0; - uuid_t uuidStore; - __block uuid_t *uuid = &uuidStore; - - dyld_image_for_each_segment_info(image, ^(const char *segmentName, - uint64_t vmAddr, - uint64_t vmSize, int perm) { - minVmAddr = std::min(minVmAddr, vmAddr); - maxVmAddr = std::max(maxVmAddr, vmAddr + vmSize); - dyld_image_copy_uuid(image, uuid); - }); - assert(minVmAddr != UINT_MAX); - assert(maxVmAddr != 0); - m_images[dyld_image_get_installname(image)] = SharedCacheImageInfo{ - UUID::fromData(uuid, 16), - std::make_shared<DataBufferUnowned>((uint8_t *)minVmAddr, - maxVmAddr - minVmAddr)}; - }); - dyld_process_snapshot_dispose(snapshot); - return; + if (auto dyld_process = dyld_process_create_for_current_task()) { + if (auto snapshot = dyld_process_snapshot_create_for_process( ---------------- should this be `auto *`? ================ Comment at: lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm:534 + if (auto dyld_process = dyld_process_create_for_current_task()) { + if (auto snapshot = dyld_process_snapshot_create_for_process( + dyld_process, nullptr)) { ---------------- ``` auto *dyld_process = dyld_process_create_for_current_task()); if (!dyld_process) return; ``` ? ================ Comment at: lldb/source/Host/macosx/objcxx/HostInfoMacOSX.mm:562 + }); + return; + } ---------------- is this redundant? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131110/new/ https://reviews.llvm.org/D131110 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits