https://github.com/JDevlieghere created 
https://github.com/llvm/llvm-project/pull/150718

Protected m_selected_frame_idx using the StackFrameList mutex. All other 
readers and writes already take the m_list_mutex so we can use that to protect 
concurrent access.

>From 0c77d94246d94004e73d7e097a36bef2db9afafd Mon Sep 17 00:00:00 2001
From: Jonas Devlieghere <jo...@devlieghere.com>
Date: Fri, 25 Jul 2025 16:05:00 -0700
Subject: [PATCH] [lldb] Protect the selected frame idx in StackFrameList

Protected m_selected_frame_idx using the StackFrameList mutex. All other
readers and writes already take the m_list_mutex so we can use that to
protect concurrent access.
---
 lldb/source/Target/StackFrameList.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lldb/source/Target/StackFrameList.cpp 
b/lldb/source/Target/StackFrameList.cpp
index 16cd2548c2784..4c5f41f292e56 100644
--- a/lldb/source/Target/StackFrameList.cpp
+++ b/lldb/source/Target/StackFrameList.cpp
@@ -783,6 +783,8 @@ void StackFrameList::SelectMostRelevantFrame() {
 
 uint32_t
 StackFrameList::GetSelectedFrameIndex(SelectMostRelevant select_most_relevant) 
{
+  std::shared_lock<std::shared_mutex> guard(m_list_mutex);
+
   if (!m_selected_frame_idx && select_most_relevant)
     SelectMostRelevantFrame();
   if (!m_selected_frame_idx) {

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to