llvm-project
77ec70fb - [lldb] Don't erase another section's entry in SetSectionLoadAddress (#245829)

Commit
4 hours ago
[lldb] Don't erase another section's entry in SetSectionLoadAddress (#245829) SetSectionLoadAddress removes a moved section's entry at its old load address from m_addr_to_sect. Since #193560 it erases whatever entry is at that address. If another section was loaded at that address after the moved section, the entry is that other section's, and erasing it leaves that section with no entry: addresses in its range no longer resolve, although GetSectionLoadAddress still returns its load address. The linear scan that #193560 replaced only ever erased an entry of the moved section. Erase the old entry only if it still maps to the moved section. Add unit tests for SectionLoadList, which had none: moving a section, moving it onto an address another section holds, a section taking over another's address, and unloading. SectionTakesOverAddress fails without this change. Assisted-by: Claude Code
Author
Parents
Loading