gdb/symtab: Allow changing of added cooked_index entries
authorTom de Vries <tdevries@suse.de>
Wed, 10 Jan 2024 09:06:35 +0000 (10:06 +0100)
committerTom de Vries <tdevries@suse.de>
Wed, 10 Jan 2024 09:06:35 +0000 (10:06 +0100)
Make cooked_index_storage::add and cooked_index_entry::add return a
"cooked_index_entry *" instead of a "const cooked_index_entry *".

Tested on x86_64-linux and ppc64le-linux.
Tested-By: Alexandra Petlanova Hajkova <ahajkova@redhat.com>
Approved-By: Tom Tromey <tom@tromey.com>
gdb/dwarf2/cooked-index.c
gdb/dwarf2/cooked-index.h

index 661edf5..c82f49e 100644 (file)
@@ -245,7 +245,7 @@ cooked_index_entry::write_scope (struct obstack *storage,
 
 /* See cooked-index.h.  */
 
-const cooked_index_entry *
+cooked_index_entry *
 cooked_index_shard::add (sect_offset die_offset, enum dwarf_tag tag,
                         cooked_index_flag flags, const char *name,
                         const cooked_index_entry *parent_entry,
index a26163f..a175f67 100644 (file)
@@ -267,11 +267,11 @@ public:
 
   /* Create a new cooked_index_entry and register it with this object.
      Entries are owned by this object.  The new item is returned.  */
-  const cooked_index_entry *add (sect_offset die_offset, enum dwarf_tag tag,
-                                cooked_index_flag flags,
-                                const char *name,
-                                const cooked_index_entry *parent_entry,
-                                dwarf2_per_cu_data *per_cu);
+  cooked_index_entry *add (sect_offset die_offset, enum dwarf_tag tag,
+                          cooked_index_flag flags,
+                          const char *name,
+                          const cooked_index_entry *parent_entry,
+                          dwarf2_per_cu_data *per_cu);
 
   /* Install a new fixed addrmap from the given mutable addrmap.  */
   void install_addrmap (addrmap_mutable *map)
@@ -383,11 +383,11 @@ public:
 
   /* Add an entry to the index.  The arguments describe the entry; see
      cooked-index.h.  The new entry is returned.  */
-  const cooked_index_entry *add (sect_offset die_offset, enum dwarf_tag tag,
-                                cooked_index_flag flags,
-                                const char *name,
-                                const cooked_index_entry *parent_entry,
-                                dwarf2_per_cu_data *per_cu)
+  cooked_index_entry *add (sect_offset die_offset, enum dwarf_tag tag,
+                          cooked_index_flag flags,
+                          const char *name,
+                          const cooked_index_entry *parent_entry,
+                          dwarf2_per_cu_data *per_cu)
   {
     return m_index->add (die_offset, tag, flags, name, parent_entry, per_cu);
   }