[Lldb-commits] [lldb] [lldb][Target] Clear selected frame index after a StopInfo::PerformAction (PR #133078)

Michael Buch via lldb-commits lldb-commits at lists.llvm.org
Thu Mar 27 03:40:48 PDT 2025


================
@@ -936,3 +936,7 @@ size_t StackFrameList::GetStatus(Stream &strm, uint32_t first_frame,
   strm.IndentLess();
   return num_frames_displayed;
 }
+
+void StackFrameList::ClearSelectedFrameIndex() {
----------------
Michael137 wrote:

Hmm we also write to `m_selected_frame_idx` in `StackFrameList::SetSelectedFrame`, which holds a `shared_lock`. I think after the refactor to make the lock non-recursive, we lost some of protection against concurrent modifications to `m_selected_frame_idx`. Probably because it wasn't ever clear what `m_list_mutex` is supposed to protect (the entire class or just the frames collection).

And we end up calling `GetSelectedFrameIndex` from `SetSelectedFrame`, so we would need to recursively lock. Unless introduce a separate mutex for `m_selected_frame_idx`, which I'm not a big fan of either tbh. Wdyt?

https://github.com/llvm/llvm-project/pull/133078


More information about the lldb-commits mailing list