X-Git-Url: https://git.saurik.com/apple/dyld.git/blobdiff_plain/16b475fcb248267b8b51f759bc62a49ec2afa88d..refs/heads/master:/dyld3/ClosurePrinter.cpp diff --git a/dyld3/ClosurePrinter.cpp b/dyld3/ClosurePrinter.cpp index 9df3d40..e73c9ad 100644 --- a/dyld3/ClosurePrinter.cpp +++ b/dyld3/ClosurePrinter.cpp @@ -49,7 +49,7 @@ static std::string printTarget(const Array& imagesArrays, Ima return std::string("bind to ") + targetImage->leafName() + " - " + hex8(-signExtend); } else - return std::string("bind to ") + targetImage->leafName() + " + " + hex8(target.image.offset); + return std::string("bind to ") + hex4(target.image.imageNum) + "-" + targetImage->leafName() + " + " + hex8(target.image.offset); break; case Image::ResolvedSymbolTarget::kindSharedCache: return std::string("bind to dyld cache + ") + hex8(target.sharedCache.offset); @@ -139,8 +139,6 @@ static const char* nameForType(TypedBytes::Type type) { return "libDyldEntry"; case TypedBytes::Type::libSystemNum: return "libSystemNum"; - case TypedBytes::Type::bootUUID: - return "bootUUID"; case TypedBytes::Type::mainEntry: return "mainEntry"; case TypedBytes::Type::startEntry: @@ -209,7 +207,6 @@ static Node buildImageNode(const Image* image, const Array& i imageNode.map["has-plus-loads"].value = (image->mayHavePlusLoads() ? "true" : "false"); imageNode.map["never-unload"].value = (image->neverUnload() ? "true" : "false"); imageNode.map["has-precomputed-objc"].value = (image->hasPrecomputedObjC() ? "true" : "false"); -// imageNode.map["platform-binary"].value = (image->isPlatformBinary() ? "true" : "false"); // if ( image->cwdMustBeThisDir() ) // imageNode.map["cwd-must-be-this-dir"].value = "true"; if ( !image->inDyldCache() ) { @@ -286,6 +283,12 @@ static Node buildImageNode(const Image* image, const Array& i } }); + uint64_t expectedInode; + uint64_t expectedMtime; + if ( image->hasFileModTimeAndInode(expectedInode, expectedMtime) ) { + imageNode.map["file-inode"].value = hex(expectedInode); + imageNode.map["file-mod-time"].value = hex(expectedMtime); + } if ( printFixups ) { image->forEachFixup(^(uint64_t imageOffsetToRebase, bool &stop) { @@ -426,6 +429,10 @@ static Node buildImageNode(const Image* image, const Array& i imageNode.map["override-of-dyld-cache-image"].value = ImageArray::findImage(imagesArrays, cacheImageNum)->path(); } + if ( image->inDyldCache() && image->overridableDylib() ) { + imageNode.map["overridable-dylib"].value = "true"; + } + #if 0 // add things to init before this image @@ -478,7 +485,7 @@ static Node buildClosureNode(const DlopenClosure* closure, const ArrayforEachPatchEntry(^(const Closure::PatchEntry& patchEntry) { Node patchNode; patchNode.map["func-dyld-cache-offset"].value = hex8(patchEntry.exportCacheOffset); - patchNode.map["func-image-num"].value = hex8(patchEntry.overriddenDylibInCache); + patchNode.map["func-image-num"].value = hex4(patchEntry.overriddenDylibInCache); patchNode.map["replacement"].value = printTarget(imagesArrays, patchEntry.replacement); root.map["dyld-cache-fixups"].array.push_back(patchNode); }); @@ -516,7 +523,7 @@ static Node buildClosureNode(const LaunchClosure* closure, const ArrayforEachPatchEntry(^(const Closure::PatchEntry& patchEntry) { Node patchNode; patchNode.map["func-dyld-cache-offset"].value = hex8(patchEntry.exportCacheOffset); - patchNode.map["func-image-num"].value = hex8(patchEntry.overriddenDylibInCache); + patchNode.map["func-image-num"].value = hex4(patchEntry.overriddenDylibInCache); patchNode.map["replacement"].value = printTarget(imagesArrays, patchEntry.replacement); root.map["dyld-cache-fixups"].array.push_back(patchNode); }); @@ -558,14 +565,6 @@ static Node buildClosureNode(const LaunchClosure* closure, const ArrayforEachPatchEntry(^(const Closure::PatchEntry& patchEntry) { - Node patchNode; - patchNode.map["func-dyld-cache-offset"].value = hex8(patchEntry.exportCacheOffset); - patchNode.map["func-image-num"].value = hex8(patchEntry.overriddenDylibInCache); - patchNode.map["replacement"].value = printTarget(imagesArrays, patchEntry.replacement); - root.map["dyld-cache-fixups"].array.push_back(patchNode); - }); - root.map["initial-image-count"].value = decimal(closure->initialLoadCount()); // add env-vars if they exist