@@ -6528,7 +6528,7 @@ static void AddRegion(const MemoryRegionInfo ®ion, bool try_dirty_pages,
65286528 CreateCoreFileMemoryRange (region));
65296529}
65306530
6531- static void AddRegisterSections (Process &process, ThreadSP &thread_sp,
6531+ static void AddSegmentRegisterSections (Process &process, ThreadSP &thread_sp,
65326532 CoreFileMemoryRanges &ranges,
65336533 lldb::addr_t range_end) {
65346534 lldb::RegisterContextSP reg_ctx = thread_sp->GetRegisterContext ();
@@ -6566,8 +6566,7 @@ static void AddRegisterSections(Process &process, ThreadSP &thread_sp,
65666566 AddRegion (register_region, true , ranges);
65676567}
65686568
6569- static void AddModuleSections (Process &process, CoreFileMemoryRanges &ranges,
6570- std::set<addr_t > &stack_ends) {
6569+ static void AddLinkMapSections (Process &process, CoreFileMemoryRanges &ranges) {
65716570 ModuleList &module_list = process.GetTarget ().GetImages ();
65726571 Target *target = &process.GetTarget ();
65736572 for (size_t idx = 0 ; idx < module_list.GetSize (); idx++) {
@@ -6588,10 +6587,6 @@ static void AddModuleSections(Process &process, CoreFileMemoryRanges &ranges,
65886587 if (err.Fail ())
65896588 continue ;
65906589
6591- // We already saved off this truncated stack range.
6592- if (stack_ends.count (tls_storage_region.GetRange ().GetRangeEnd ()) > 0 )
6593- continue ;
6594-
65956590 AddRegion (tls_storage_region, true , ranges);
65966591 }
65976592}
@@ -6633,7 +6628,7 @@ static void SaveOffRegionsWithStackPointers(Process &process,
66336628 // or contains the thread id from thread_sp.
66346629 if (core_options.ShouldThreadBeSaved (thread_sp->GetID ())) {
66356630 AddRegion (sp_region, try_dirty_pages, ranges);
6636- AddRegisterSections (process, thread_sp, ranges, range_end);
6631+ AddSegmentRegisterSections (process, thread_sp, ranges, range_end);
66376632 }
66386633 }
66396634 }
@@ -6747,8 +6742,8 @@ Status Process::CalculateCoreFileSaveRanges(const SaveCoreOptions &options,
67476742 options.HasSpecifiedThreads ()) {
67486743 SaveOffRegionsWithStackPointers (*this , options, regions, ranges,
67496744 stack_ends);
6750- // Save off the load sections for the TLS data.
6751- AddModuleSections (*this , ranges, stack_ends );
6745+ // We need the link map for TLS data.
6746+ AddLinkMapSections (*this , ranges);
67526747 }
67536748
67546749 switch (core_style) {
0 commit comments