================
@@ -46,8 +46,59 @@ SaveCoreOptions::GetOutputFile() const {
return m_file;
}
+void SaveCoreOptions::AddThread(lldb::tid_t tid) {
+ if (m_threads_to_save.count(tid) == 0)
+ m_threads_to_save.emplace(tid);
+}
+
+bool SaveCoreOptions::RemoveThread(lldb::tid_t tid) {
+ if (m_threads_to_save.count(tid) == 0) {
+ m_threads_to_save.erase(tid);
+ return true;
+ }
+
+ return false;
+}
+
+size_t SaveCoreOptions::GetNumThreads() const {
+ return m_threads_to_save.size();
+}
+
+int64_t SaveCoreOptions::GetThreadAtIndex(size_t index) const {
+ auto iter = m_threads_to_save.begin();
+ while (index >= 0 && iter != m_threads_to_save.end()) {
+ if (index == 0)
+ return *iter;
+ index--;
+ iter++;
+ }
----------------
Jlalond wrote:
Should we support returning at an index then? To be clear, I do not like this
code but due to my limited C++ knowledge didn't know a better way to return the
`Nth item of a set`
https://github.com/llvm/llvm-project/pull/100443
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits