Change parameters to write_address_map
authorTom Tromey <tom@tromey.com>
Thu, 27 May 2021 22:29:52 +0000 (16:29 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 12 Apr 2022 15:31:16 +0000 (09:31 -0600)
To support the removal of partial symtabs from the DWARF index writer,
this makes a small change to have write_address_map accept the address
map as a parameter, rather than assuming it always comes from the
per-BFD object.

gdb/dwarf2/index-write.c

index 958fc9bed3bcf425f66c139961cf10cbd641627e..509dde462e36ff262e7e34680fe376b227248473 100644 (file)
@@ -473,13 +473,12 @@ addrmap_index_data::operator() (CORE_ADDR start_addr, void *obj)
    in the index file.  */
 
 static void
-write_address_map (dwarf2_per_bfd *per_bfd, data_buf &addr_vec,
+write_address_map (struct addrmap *addrmap, data_buf &addr_vec,
                   cu_index_map &cu_index_htab)
 {
   struct addrmap_index_data addrmap_index_data (addr_vec, cu_index_htab);
 
-  addrmap_foreach (per_bfd->partial_symtabs->psymtabs_addrmap,
-                  addrmap_index_data);
+  addrmap_foreach (addrmap, addrmap_index_data);
 
   /* It's highly unlikely the last entry (end address = 0xff...ff)
      is valid, but we should still handle it.
@@ -1378,7 +1377,8 @@ write_gdbindex (dwarf2_per_objfile *per_objfile, FILE *out_file,
 
   /* Dump the address map.  */
   data_buf addr_vec;
-  write_address_map (per_objfile->per_bfd, addr_vec, cu_index_htab);
+  write_address_map (per_objfile->per_bfd->partial_symtabs->psymtabs_addrmap,
+                    addr_vec, cu_index_htab);
 
   /* Now that we've processed all symbols we can shrink their cu_indices
      lists.  */