[Lldb-commits] [lldb] [lldb] Don't unregister a listener that's being destroyed (PR #97300)

via lldb-commits lldb-commits at lists.llvm.org
Tue Jul 2 10:27:36 PDT 2024


jimingham wrote:

> Thanks for the explanation. I believe I understand the purpose of the primary listener. While I'm not sure that a "shared pointer" is the best way to express the "someone must exist on the other end to pull the events" notion, I'm not interested in revisiting that decision, so I'll remove that part of the commit message.

Holding a shared pointer isn't really about making sure the client that provides the Listener is doing the right thing with it.  Rather, the shared-pointer-ness coupled with the fact that you have to provide a Listener to make a Process mean that the Process event code never has to reason about what to do if it didn't have a Listener, which would be a pointless complication.

I didn't try hard to come up with a way to enforce correct behavior on the client side because the fact that the debug session produced thereby wouldn't work seems a sufficient enforcement mechanism.

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


More information about the lldb-commits mailing list