@@ -576,31 +576,36 @@ void SharedCache::PerformInitialLoad()
576576 }
577577
578578 // Load .symbols subcache
579+ try {
580+ auto subCachePath = path + " .symbols" ;
581+ auto subCacheFile = MMappedFileAccessor::Open (m_dscView, m_dscView->GetFile ()->GetSessionId (), subCachePath)->lock ();
579582
580- auto subCachePath = path + " .symbols" ;
581- auto subCacheFile = MMappedFileAccessor::Open (m_dscView, m_dscView->GetFile ()->GetSessionId (), subCachePath)->lock ();
583+ dyld_cache_header subCacheHeader {};
584+ uint64_t headerSize = subCacheFile->ReadUInt32 (16 );
585+ if (headerSize > sizeof (dyld_cache_header))
586+ {
587+ m_logger->LogDebug (" Header size is larger than expected (0x%llx), using default size (0x%llx)" , headerSize,
588+ sizeof (dyld_cache_header));
589+ headerSize = sizeof (dyld_cache_header);
590+ }
591+ subCacheFile->Read (&subCacheHeader, 0 , headerSize);
582592
583- dyld_cache_header subCacheHeader {};
584- uint64_t headerSize = subCacheFile->ReadUInt32 (16 );
585- if (headerSize > sizeof (dyld_cache_header))
586- {
587- m_logger->LogDebug (" Header size is larger than expected (0x%llx), using default size (0x%llx)" , headerSize,
588- sizeof (dyld_cache_header));
589- headerSize = sizeof (dyld_cache_header);
590- }
591- subCacheFile->Read (&subCacheHeader, 0 , headerSize);
593+ dyld_cache_mapping_info subCacheMapping {};
594+ BackingCache subCache;
592595
593- dyld_cache_mapping_info subCacheMapping {};
594- BackingCache subCache;
596+ for (size_t j = 0 ; j < subCacheHeader.mappingCount ; j++)
597+ {
598+ subCacheFile->Read (&subCacheMapping, subCacheHeader.mappingOffset + (j * sizeof (subCacheMapping)),
599+ sizeof (subCacheMapping));
600+ subCache.mappings .push_back (subCacheMapping);
601+ }
595602
596- for (size_t j = 0 ; j < subCacheHeader.mappingCount ; j++)
603+ MutableState ().backingCaches .push_back (std::move (subCache));
604+ }
605+ catch (...)
597606 {
598- subCacheFile->Read (&subCacheMapping, subCacheHeader.mappingOffset + (j * sizeof (subCacheMapping)),
599- sizeof (subCacheMapping));
600- subCache.mappings .push_back (subCacheMapping);
607+ m_logger->LogWarn (" Failed to locate .symbols subcache. Non-exported symbol information may be missing." );
601608 }
602-
603- MutableState ().backingCaches .push_back (std::move (subCache));
604609 break ;
605610 }
606611 case iOS16CacheFormat:
0 commit comments