File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ class SaveCoreOptions {
5757 std::optional<lldb_private::FileSpec> m_file;
5858 std::optional<lldb::SaveCoreStyle> m_style;
5959 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;
6161 MemoryRanges m_regions_to_save;
6262};
6363} // namespace lldb_private
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ Status SaveCoreOptions::AddThread(lldb::ThreadSP thread_sp) {
8787 m_process_sp = thread_sp->GetProcess ();
8888 }
8989
90- m_threads_to_save.insert ({ thread_sp->GetID (), thread_sp} );
90+ m_threads_to_save.insert (thread_sp->GetID ());
9191 return error;
9292}
9393
@@ -118,9 +118,13 @@ const MemoryRanges &SaveCoreOptions::GetCoreFileMemoryRanges() const {
118118lldb::ThreadCollectionSP SaveCoreOptions::GetThreadsToSave () const {
119119 lldb::ThreadCollectionSP threadcollection_sp =
120120 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+
124128 return threadcollection_sp;
125129}
126130
You can’t perform that action at this time.
0 commit comments