[Lldb-commits] [lldb] [lldb] Implement bidirectional access for backing<->backed thread relationship (PR #125300)

via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 31 16:36:11 PST 2025


================
@@ -470,6 +470,18 @@ class Thread : public std::enable_shared_from_this<Thread>,
 
   virtual void ClearStackFrames();
 
+  /// Derived classes implementing SetBackingThread should use this to provide
+  /// bidirectional access to the Backing-Backed relationship.
+  void SetBackedThread(Thread &backed_thread) {
----------------
jimingham wrote:

You have an assert that's requiring that `backed_thread` has to have had its backing thread set first, then passed to this API.  Would it be a more user-friendly API if it set the backed_thread's backing thread here, if it isn't already set.
It's still fine to assert if somebody set the wrong backing thread, that seems like an unintended error.  But if the backed_thread.GetBackingThread was null, is there any reason not to set it for them here?

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


More information about the lldb-commits mailing list