[all-commits] [llvm/llvm-project] 8fb919: [lldb] Symtab::SectionFileAddressesChanged should ...

Alex via All-commits all-commits at lists.llvm.org
Thu Jun 15 14:48:26 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8fb919a1154a593fdf01e759ece7904afc73f687
      https://github.com/llvm/llvm-project/commit/8fb919a1154a593fdf01e759ece7904afc73f687
  Author: Alex Langford <alangford at apple.com>
  Date:   2023-06-15 (Thu, 15 Jun 2023)

  Changed paths:
    M lldb/source/Symbol/Symtab.cpp

  Log Message:
  -----------
  [lldb] Symtab::SectionFileAddressesChanged should clear the file address map instead of name map

Currently, `SectionFileAddressesChanged` clears out the `name_to_index`
map and sets `m_file_addr_to_index_compute` to false. This is strange,
as these two fields are used for different purposes. What we should be
doing is clearing the file address to index mapping.

There are 2 bugs here:
1. If we call SectionFileAddressesChanged after the name indexes have
   been computed, we end up with an empty name to index map, so lookups
   will fail. This doesn't happen today because we don't initialize the
   name indexes before calling this, but this is a refactor away from
   failing in this way.
2. Because we don't clear `m_file_addr_to_index` but still set it's
   computed flag to false, it ends up with twice the amount of
   information. One entry will be correct (since it was recalculated),
   one entry will be outdated.

rdar://110192434

Differential Revision: https://reviews.llvm.org/D152579




More information about the All-commits mailing list