[Lldb-commits] [lldb] [lldb] Clear ModuleList shared modules in SBDebugger::Clear (PR #147289)

Andrew Savonichev via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 2 04:54:27 PDT 2025


asavonic wrote:

@jimingham, thanks a lot for the explanation! I think `MemoryPressureDetected` is a better solution than what I was trying to do originally. 

> I'd suggest adding another API like `RemoveAllSharedModules` that ignores reference count - but that API should only ever be called from Debugger::Terminate.

I almost prepared a patch to add that, but tests highlighted another problem - there seems to be no way to recover from `Debugger::Terminate` and re-initialize. Initialization fails because Terminate leaves global pointers as non-zero and we get `Debugger::Initialize called more than once!`. Without a way to re-initialize, this dance around modules in Terminate makes even less sense. I think we can drop this patch, I don't see a practical reason to do it.

Thank you @jimingham and @JDevlieghere for your guidance here.

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


More information about the lldb-commits mailing list