diff options
Diffstat (limited to 'gdb/dwarf2/index-write.c')
-rw-r--r-- | gdb/dwarf2/index-write.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c index 58b0f0b..b7a2e21 100644 --- a/gdb/dwarf2/index-write.c +++ b/gdb/dwarf2/index-write.c @@ -1087,12 +1087,11 @@ write_gdbindex_1 (FILE *out_file, /* Write the contents of the internal "cooked" index. */ static void -write_cooked_index (dwarf2_per_objfile *per_objfile, +write_cooked_index (cooked_index_vector *table, const cu_index_map &cu_index_htab, struct mapped_symtab *symtab) { - for (const cooked_index_entry *entry - : per_objfile->per_bfd->cooked_index_table->all_entries ()) + for (const cooked_index_entry *entry : table->all_entries ()) { const auto it = cu_index_htab.find (entry->per_cu); gdb_assert (it != cu_index_htab.cend ()); @@ -1178,13 +1177,14 @@ write_gdbindex (dwarf2_per_objfile *per_objfile, FILE *out_file, ++this_counter; } - write_cooked_index (per_objfile, cu_index_htab, &symtab); + cooked_index_vector *table + = (static_cast<cooked_index_vector *> + (per_objfile->per_bfd->index_table.get ())); + write_cooked_index (table, cu_index_htab, &symtab); /* Dump the address map. */ data_buf addr_vec; - std::vector<addrmap *> addrmaps - = per_objfile->per_bfd->cooked_index_table->get_addrmaps (); - for (auto map : addrmaps) + for (auto map : table->get_addrmaps ()) write_address_map (map, addr_vec, cu_index_htab); /* Now that we've processed all symbols we can shrink their cu_indices @@ -1250,8 +1250,10 @@ write_debug_names (dwarf2_per_objfile *per_objfile, - per_objfile->per_bfd->tu_stats.nr_tus)); gdb_assert (types_counter == per_objfile->per_bfd->tu_stats.nr_tus); - for (const cooked_index_entry *entry - : per_objfile->per_bfd->cooked_index_table->all_entries ()) + cooked_index_vector *table + = (static_cast<cooked_index_vector *> + (per_objfile->per_bfd->index_table.get ())); + for (const cooked_index_entry *entry : table->all_entries ()) nametable.insert (entry); nametable.build (); @@ -1388,10 +1390,12 @@ write_dwarf_index (dwarf2_per_objfile *per_objfile, const char *dir, { struct objfile *objfile = per_objfile->objfile; - if (per_objfile->per_bfd->cooked_index_table == nullptr) + cooked_index_vector *table + = (static_cast<cooked_index_vector *> + (per_objfile->per_bfd->index_table.get ())); + if (table == nullptr) { - if (per_objfile->per_bfd->index_table != nullptr - || per_objfile->per_bfd->debug_names_table != nullptr) + if (per_objfile->per_bfd->index_table != nullptr) error (_("Cannot use an index to create the index")); error (_("No debugging symbols")); } |