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.
Details
Details
- Reviewers
labath aadsm dvlahovski - Commits
- rG0156be59b45d: 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…
rLLDB374242: Fix a crasher due to an assert when two files have the same UUID but different…
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Looks good, modulo the comment about shadowing.
lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp | ||
---|---|---|
115 | 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. |
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.