The PlaceholderObjectFile has an assert in SetLoadAddress that fires if "m_base == value" is not true. To avoid this, we create check that the base address matches, and if it doesn't we clear the module that was found using the UUID so that we create a new PlaceholderObjectFile. Added a test to cover this issue.
labath aadsm dvlahovski
- rG0156be59b45d: Fix a crasher due to an assert when two files have the same UUID but different…
rLLDB374242: Fix a crasher due to an assert when two files have the same UUID but different…
rL374242: Fix a crasher due to an assert when two files have the same UUID but different…
Looks good, modulo the comment about shadowing.
This implements something very similar to the GetBaseAddress function on line 81 (it is equivalent to const_cast<PlaceholderObjectFile *>(this)->GetBaseAddress().GetFileAddress()). In fact, the only reason you could define this function is because it is const, while the other method is not. Having two methods with the same name returning different types is very confusing. I think you should just drop this and replace the call on line 417 with objfile->GetBaseAddress().GetFileAddress(). That way, you don't even need to cast anything.