[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 Jul 8 18:47:31 PDT 2025
asavonic wrote:
Updated the patch to [use RemoveOrphanSharedModules](https://github.com/llvm/llvm-project/pull/147289/commits/7a27fe962726c3190ce6ad7d635e3ae30a0f52f7) instead of force-clearing the cache.
Changed the description as well.
> No one SBDebugger should force-clear the Shared Module Cache. That's a resource shared among all the SBDebuggers, and no SBDebugger can know what the other debugger's intentions are w.r.t. it. That seems wrong to me.
Agree.
> The most an SBDebugger should do on Destroy or Clear is call MemoryPressureDetected or a similar lower-level API to clear all the modules that it is the only owner of. It should not clear the cache out from under other users.
The last revision should do that. The downside is that the program must release all shared pointers to modules before calling `Destroy`, or they leak again.
https://github.com/llvm/llvm-project/pull/147289
More information about the lldb-commits
mailing list