]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/dwarf: set is_debug_types in signatured_type constructor
authorSimon Marchi <simon.marchi@polymtl.ca>
Mon, 17 Feb 2025 19:59:35 +0000 (14:59 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 19 Feb 2025 16:14:41 +0000 (11:14 -0500)
This makes it more obvious that all created signatured_type objects have
this flag set.

Also, remove an unnecessary assignment in create_cus_hash_table: when
constructing the dwarf2_per_cu_data object, is_debug_types is already
initialized to 0/false.

Change-Id: I6d28b17ac77edc040172254f6970d05ebc4a47f4
Approved-By: Tom Tromey <tom@tromey.com>
gdb/dwarf2/read.c
gdb/dwarf2/read.h

index de932a82fe0f779ec04635716a44fe2877981596..e5bb4e2605065e1c08b5ae491e960bec00ef18cf 100644 (file)
@@ -1835,7 +1835,6 @@ dwarf2_per_bfd::allocate_signatured_type (dwarf2_section_info *section,
   auto result
     = std::make_unique<signatured_type> (this, section, sect_off, signature);
   result->index = all_units.size ();
-  result->is_debug_types = true;
   tu_stats.nr_tus++;
   return result;
 }
@@ -7149,7 +7148,6 @@ create_cus_hash_table (dwarf2_per_objfile *per_objfile,
       sect_offset sect_off = (sect_offset) (info_ptr - section.buffer);
 
       dwarf2_per_cu_data per_cu (per_bfd, &section, sect_off);
-      per_cu.is_debug_types = 0;
 
       cutu_reader reader (&per_cu, per_objfile, cu, &dwo_file);
       if (!reader.dummy_p)
index 2aa6e58ddaffe53802804b474ac3097bdaa30143..56705c5a193b92e73f2970ebca7130fca2318a30 100644 (file)
@@ -375,7 +375,9 @@ struct signatured_type : public dwarf2_per_cu_data
                   sect_offset sect_off, ULONGEST signature)
     : dwarf2_per_cu_data (per_bfd, section, sect_off),
       signature (signature)
-  {}
+  {
+    this->is_debug_types = true;
+  }
 
   /* The type's signature.  */
   ULONGEST signature;