clayborg added a comment.

Everything looks good, just a question in inlined comment about having a thread 
plan hold onto a pointer to a thread. Seems dangerous



================
Comment at: lldb/include/lldb/Target/ThreadPlan.h:601
 
+  Thread *m_thread;
   ThreadPlanKind m_kind;
----------------
This seems dangerous to hold onto? It can go stale if the thread goes away 
right? If we have the m_tid, why do we need this? If we want a thread pointer 
in this class, should it be a std::weak_ptr? It also seems that if we make a 
ThreadRef class that is something like:

```
struct ThreadRef {
  std::weak_ptr<lldb_private::Thread> m_thread_wp;
  lldb::tid_t m_tid;
};
```

We could re-use this in this class and ExecutionContextRef.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75711/new/

https://reviews.llvm.org/D75711



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

Reply via email to