hanchenye-llvm-project/lldb/lldb.xcodeproj
Enrico Granata 106aae5108 Because of our lifetime rules w.r.t. ValueObjects and ClusterManagers, synthetic children caching is a tricky area:
- if a synthetic child comes from the same hierarchy as its parent object, then it can't be cached by SharedPointer inside the synthetic provider, or it will cause a reference loop;
- but, if a synthetic child is made from whole cloth (e.g. from an expression, a memory region, ...), then it better be cached by SharedPointer, or it will be cleared out and cause an assert() to fail if used at a later point

For most cases of self-rooted synthetic children, we have a flag we set "IsSyntheticChildrenGenerated", but we were not using it to track caching. So, what ended up happening is each provider would set up its own cache, and if it got it wrong, a hard to diagnose crash would ensue

This patch fixes that by centralizing caching in ValueObjectSynthetic - if a provider returns a self-rooted child (as per the flag), then it gets cached centrally by the ValueObject itself
This cache is used only for lifetime management and not later retrieval of child values - a different cache handles that (because we might have a mix of self-rooted and properly nested child values for the same parent, we can't trivially use this lifetime cache for retrieval)

Fixes rdar://26480007

llvm-svn: 274683
2016-07-06 21:24:28 +00:00
..
project.xcworkspace
xcshareddata/xcschemes Add an "offset" option to "break set -n" and "break set -f -l". 2016-03-09 18:59:13 +00:00
project.pbxproj Because of our lifetime rules w.r.t. ValueObjects and ClusterManagers, synthetic children caching is a tricky area: 2016-07-06 21:24:28 +00:00