@@ -918,11 +918,6 @@ ConstString ObjectFileMachO::GetSectionNameEHFrame() {
918
918
return g_section_name_eh_frame;
919
919
}
920
920
921
- ConstString ObjectFileMachO::GetSectionNameLLDBNoNlist () {
922
- static ConstString g_section_name_lldb_no_nlist (" __lldb_no_nlist" );
923
- return g_section_name_lldb_no_nlist;
924
- }
925
-
926
921
bool ObjectFileMachO::MagicBytesMatch (DataBufferSP data_sp,
927
922
lldb::addr_t data_offset,
928
923
lldb::addr_t data_length) {
@@ -2399,54 +2394,15 @@ void ObjectFileMachO::ParseSymtab(Symtab &symtab) {
2399
2394
uint32_t memory_module_load_level = eMemoryModuleLoadLevelComplete;
2400
2395
bool is_shared_cache_image = IsSharedCacheBinary ();
2401
2396
bool is_local_shared_cache_image = is_shared_cache_image && !IsInMemory ();
2402
-
2403
- ConstString g_segment_name_TEXT = GetSegmentNameTEXT ();
2404
- ConstString g_segment_name_DATA = GetSegmentNameDATA ();
2405
- ConstString g_segment_name_DATA_DIRTY = GetSegmentNameDATA_DIRTY ();
2406
- ConstString g_segment_name_DATA_CONST = GetSegmentNameDATA_CONST ();
2407
- ConstString g_segment_name_OBJC = GetSegmentNameOBJC ();
2408
- ConstString g_section_name_eh_frame = GetSectionNameEHFrame ();
2409
- ConstString g_section_name_lldb_no_nlist = GetSectionNameLLDBNoNlist ();
2410
- SectionSP text_section_sp (
2411
- section_list->FindSectionByName (g_segment_name_TEXT));
2412
- SectionSP data_section_sp (
2413
- section_list->FindSectionByName (g_segment_name_DATA));
2414
2397
SectionSP linkedit_section_sp (
2415
2398
section_list->FindSectionByName (GetSegmentNameLINKEDIT ()));
2416
- SectionSP data_dirty_section_sp (
2417
- section_list->FindSectionByName (g_segment_name_DATA_DIRTY));
2418
- SectionSP data_const_section_sp (
2419
- section_list->FindSectionByName (g_segment_name_DATA_CONST));
2420
- SectionSP objc_section_sp (
2421
- section_list->FindSectionByName (g_segment_name_OBJC));
2422
- SectionSP eh_frame_section_sp;
2423
- SectionSP lldb_no_nlist_section_sp;
2424
- if (text_section_sp.get ()) {
2425
- eh_frame_section_sp = text_section_sp->GetChildren ().FindSectionByName (
2426
- g_section_name_eh_frame);
2427
- lldb_no_nlist_section_sp = text_section_sp->GetChildren ().FindSectionByName (
2428
- g_section_name_lldb_no_nlist);
2429
- } else {
2430
- eh_frame_section_sp =
2431
- section_list->FindSectionByName (g_section_name_eh_frame);
2432
- lldb_no_nlist_section_sp =
2433
- section_list->FindSectionByName (g_section_name_lldb_no_nlist);
2434
- }
2435
2399
2436
2400
if (process && m_header.filetype != llvm::MachO::MH_OBJECT &&
2437
2401
!is_local_shared_cache_image) {
2438
2402
Target &target = process->GetTarget ();
2439
2403
2440
2404
memory_module_load_level = target.GetMemoryModuleLoadLevel ();
2441
2405
2442
- // If __TEXT,__lldb_no_nlist section is present in this binary,
2443
- // and we're reading it out of memory, do not read any of the
2444
- // nlist entries. They are not needed in lldb and it may be
2445
- // expensive to load these. This is to handle a dylib consisting
2446
- // of only metadata, no code, but it has many nlist entries.
2447
- if (lldb_no_nlist_section_sp)
2448
- memory_module_load_level = eMemoryModuleLoadLevelMinimal;
2449
-
2450
2406
// Reading mach file from memory in a process or core file...
2451
2407
2452
2408
if (linkedit_section_sp) {
@@ -2570,6 +2526,30 @@ void ObjectFileMachO::ParseSymtab(Symtab &symtab) {
2570
2526
2571
2527
const bool have_strtab_data = strtab_data.GetByteSize () > 0 ;
2572
2528
2529
+ ConstString g_segment_name_TEXT = GetSegmentNameTEXT ();
2530
+ ConstString g_segment_name_DATA = GetSegmentNameDATA ();
2531
+ ConstString g_segment_name_DATA_DIRTY = GetSegmentNameDATA_DIRTY ();
2532
+ ConstString g_segment_name_DATA_CONST = GetSegmentNameDATA_CONST ();
2533
+ ConstString g_segment_name_OBJC = GetSegmentNameOBJC ();
2534
+ ConstString g_section_name_eh_frame = GetSectionNameEHFrame ();
2535
+ SectionSP text_section_sp (
2536
+ section_list->FindSectionByName (g_segment_name_TEXT));
2537
+ SectionSP data_section_sp (
2538
+ section_list->FindSectionByName (g_segment_name_DATA));
2539
+ SectionSP data_dirty_section_sp (
2540
+ section_list->FindSectionByName (g_segment_name_DATA_DIRTY));
2541
+ SectionSP data_const_section_sp (
2542
+ section_list->FindSectionByName (g_segment_name_DATA_CONST));
2543
+ SectionSP objc_section_sp (
2544
+ section_list->FindSectionByName (g_segment_name_OBJC));
2545
+ SectionSP eh_frame_section_sp;
2546
+ if (text_section_sp.get ())
2547
+ eh_frame_section_sp = text_section_sp->GetChildren ().FindSectionByName (
2548
+ g_section_name_eh_frame);
2549
+ else
2550
+ eh_frame_section_sp =
2551
+ section_list->FindSectionByName (g_section_name_eh_frame);
2552
+
2573
2553
const bool is_arm = (m_header.cputype == llvm::MachO::CPU_TYPE_ARM);
2574
2554
const bool always_thumb = GetArchitecture ().IsAlwaysThumbInstructions ();
2575
2555
0 commit comments