@@ -2408,45 +2408,44 @@ void ObjectFileMachO::ParseSymtab(Symtab &symtab) {
24082408 strtab_addr = linkedit_load_addr + symtab_load_command.stroff -
24092409 linkedit_file_offset;
24102410
2411- // Always load dyld - the dynamic linker - from memory if we didn't
2412- // find a binary anywhere else. lldb will not register
2413- // dylib/framework/bundle loads/unloads if we don't have the dyld
2414- // symbols, we force dyld to load from memory despite the user's
2415- // target.memory-module-load-level setting.
2416- if (memory_module_load_level == eMemoryModuleLoadLevelComplete ||
2417- m_header.filetype == llvm::MachO::MH_DYLINKER) {
2418- DataBufferSP nlist_data_sp (
2419- ReadMemory (process_sp, symoff_addr, nlist_data_byte_size));
2420- if (nlist_data_sp)
2421- nlist_data.SetData (nlist_data_sp, 0 , nlist_data_sp->GetByteSize ());
2422- if (dysymtab.nindirectsyms != 0 ) {
2423- const addr_t indirect_syms_addr = linkedit_load_addr +
2424- dysymtab.indirectsymoff -
2425- linkedit_file_offset;
2426- DataBufferSP indirect_syms_data_sp (ReadMemory (
2427- process_sp, indirect_syms_addr, dysymtab.nindirectsyms * 4 ));
2428- if (indirect_syms_data_sp)
2429- indirect_symbol_index_data.SetData (
2430- indirect_syms_data_sp, 0 ,
2431- indirect_syms_data_sp->GetByteSize ());
2432- // If this binary is outside the shared cache,
2433- // cache the string table.
2434- // Binaries in the shared cache all share a giant string table,
2435- // and we can't share the string tables across multiple
2436- // ObjectFileMachO's, so we'd end up re-reading this mega-strtab
2437- // for every binary in the shared cache - it would be a big perf
2438- // problem. For binaries outside the shared cache, it's faster to
2439- // read the entire strtab at once instead of piece-by-piece as we
2440- // process the nlist records.
2441- if (!is_shared_cache_image) {
2442- DataBufferSP strtab_data_sp (
2443- ReadMemory (process_sp, strtab_addr, strtab_data_byte_size));
2444- if (strtab_data_sp) {
2445- strtab_data.SetData (strtab_data_sp, 0 ,
2446- strtab_data_sp->GetByteSize ());
2447- }
2411+ // Always load dyld - the dynamic linker - from memory if we didn't
2412+ // find a binary anywhere else. lldb will not register
2413+ // dylib/framework/bundle loads/unloads if we don't have the dyld
2414+ // symbols, we force dyld to load from memory despite the user's
2415+ // target.memory-module-load-level setting.
2416+ if (memory_module_load_level == eMemoryModuleLoadLevelComplete ||
2417+ m_header.filetype == llvm::MachO::MH_DYLINKER) {
2418+ DataBufferSP nlist_data_sp (
2419+ ReadMemory (process_sp, symoff_addr, nlist_data_byte_size));
2420+ if (nlist_data_sp)
2421+ nlist_data.SetData (nlist_data_sp, 0 , nlist_data_sp->GetByteSize ());
2422+ if (dysymtab.nindirectsyms != 0 ) {
2423+ const addr_t indirect_syms_addr = linkedit_load_addr +
2424+ dysymtab.indirectsymoff -
2425+ linkedit_file_offset;
2426+ DataBufferSP indirect_syms_data_sp (ReadMemory (
2427+ process_sp, indirect_syms_addr, dysymtab.nindirectsyms * 4 ));
2428+ if (indirect_syms_data_sp)
2429+ indirect_symbol_index_data.SetData (
2430+ indirect_syms_data_sp, 0 , indirect_syms_data_sp->GetByteSize ());
2431+ // If this binary is outside the shared cache,
2432+ // cache the string table.
2433+ // Binaries in the shared cache all share a giant string table,
2434+ // and we can't share the string tables across multiple
2435+ // ObjectFileMachO's, so we'd end up re-reading this mega-strtab
2436+ // for every binary in the shared cache - it would be a big perf
2437+ // problem. For binaries outside the shared cache, it's faster to
2438+ // read the entire strtab at once instead of piece-by-piece as we
2439+ // process the nlist records.
2440+ if (!is_shared_cache_image) {
2441+ DataBufferSP strtab_data_sp (
2442+ ReadMemory (process_sp, strtab_addr, strtab_data_byte_size));
2443+ if (strtab_data_sp) {
2444+ strtab_data.SetData (strtab_data_sp, 0 ,
2445+ strtab_data_sp->GetByteSize ());
24482446 }
24492447 }
2448+ }
24502449 if (memory_module_load_level >= eMemoryModuleLoadLevelPartial) {
24512450 if (function_starts_load_command.cmd ) {
24522451 const addr_t func_start_addr =
0 commit comments