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
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to