File tree 2 files changed +9
-5
lines changed
2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ class SaveCoreOptions {
57
57
std::optional<lldb_private::FileSpec> m_file;
58
58
std::optional<lldb::SaveCoreStyle> m_style;
59
59
lldb::ProcessSP m_process_sp;
60
- std::unordered_map <lldb::tid_t , lldb::ThreadSP > m_threads_to_save;
60
+ std::unordered_set <lldb::tid_t > m_threads_to_save;
61
61
MemoryRanges m_regions_to_save;
62
62
};
63
63
} // namespace lldb_private
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ Status SaveCoreOptions::AddThread(lldb::ThreadSP thread_sp) {
87
87
m_process_sp = thread_sp->GetProcess ();
88
88
}
89
89
90
- m_threads_to_save.insert ({ thread_sp->GetID (), thread_sp} );
90
+ m_threads_to_save.insert (thread_sp->GetID ());
91
91
return error;
92
92
}
93
93
@@ -118,9 +118,13 @@ const MemoryRanges &SaveCoreOptions::GetCoreFileMemoryRanges() const {
118
118
lldb::ThreadCollectionSP SaveCoreOptions::GetThreadsToSave () const {
119
119
lldb::ThreadCollectionSP threadcollection_sp =
120
120
std::make_shared<ThreadCollection>();
121
- for (const auto &thread : m_threads_to_save) {
122
- threadcollection_sp->AddThread (thread.second );
123
- }
121
+ if (!m_process_sp)
122
+ return threadcollection_sp;
123
+
124
+ ThreadList &thread_list = m_process_sp->GetThreadList ();
125
+ for (const auto &tid : m_threads_to_save)
126
+ threadcollection_sp->AddThread (thread_list.FindThreadByID (tid));
127
+
124
128
return threadcollection_sp;
125
129
}
126
130
You can’t perform that action at this time.
0 commit comments