jimingham wrote:

For the first half, maybe you would avoid crashes by keeping everything around, 
but you could end up having a global variable that got its type from one Module 
and then you replace the module with another and get a local variable out of 
them and now you have some stale types and some new ones...  That just seems 
like leading towards confusion even if not crashes.

It sounds to me like you are trying to model lazy module creation, so it seems 
like it would be better to do that explicitly rather than have the user have to 
juggle this and hope they didn't cause any confusions.  

You could for instance make a placeholder Module class that can answer the sort 
of questions the ModuleSpec provides answers to.   If you ask it any questions 
that might require more information, the Placeholder Module could use the 
ModuleLocator to realize the actual module, and hold that as a private module 
in the Placeholder and forward all questions it couldn't answer to the 
privately held module.  Everything you got from the Module would be from one 
source, and so would stay consistent.  If another Target came along and asked 
for the same UUID it wouldn't be a crap-shoot what it got.  It would get the 
placeholder Module from the global module cache and everything would stay 
orderly.

https://github.com/llvm/llvm-project/pull/214576
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to