]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Allow reference form for DW_AT_associated and DW_AT_allocated attributes
authorAlok Kumar Sharma <AlokKumar.Sharma@amd.com>
Wed, 1 Jul 2020 06:23:09 +0000 (11:53 +0530)
committeralosharm <AlokKumar.Sharma@amd.com>
Wed, 1 Jul 2020 11:27:17 +0000 (16:57 +0530)
Currently, GDB rejects the (die) reference form while it accepts exprloc
form. It is allowed in DWARF standard. "Table 7.5: Attribute encodings"
in DWARF5 standard. Flang compiler assigns (die) reference to
DW_AT_associated and DW_AT_allocated for some cases.

gdb/ChangeLog

* dwarf2/read.c (set_die_type): Removed conditions to restrict
forms for DW_AT_associated and DW_AT_allocated attributes,
which is already checked in function attr_to_dynamic_prop.

gdb/ChangeLog
gdb/dwarf2/read.c

index d64f572e071d14c6bce2a05c5602dfccd1b29351..404ee40667895438752ba2ac74295a4928c6b175 100644 (file)
@@ -1,3 +1,9 @@
+2020-07-01  Alok Kumar Sharma  <AlokKumar.Sharma@amd.com>
+
+       * dwarf2/read.c (set_die_type): Removed conditions to restrict
+       forms for DW_AT_associated and DW_AT_allocated attributes,
+       which is already checked in function attr_to_dynamic_prop.
+
 2020-06-30  Tom Tromey  <tromey@adacore.com>
 
        * dwarf2/read.c (quirk_rust_enum): Correctly call
index b097f624b6c4882c82718773145bed2614978a07..4622d14a05c6819b482c9c97c14a14755876aa72 100644 (file)
@@ -23859,33 +23859,21 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
 
   /* Read DW_AT_allocated and set in type.  */
   attr = dwarf2_attr (die, DW_AT_allocated, cu);
-  if (attr != NULL && attr->form_is_block ())
+  if (attr != NULL)
     {
       struct type *prop_type = cu->addr_sized_int_type (false);
       if (attr_to_dynamic_prop (attr, die, cu, &prop, prop_type))
         type->add_dyn_prop (DYN_PROP_ALLOCATED, prop);
     }
-  else if (attr != NULL)
-    {
-      complaint (_("DW_AT_allocated has the wrong form (%s) at DIE %s"),
-                (attr != NULL ? dwarf_form_name (attr->form) : "n/a"),
-                sect_offset_str (die->sect_off));
-    }
 
   /* Read DW_AT_associated and set in type.  */
   attr = dwarf2_attr (die, DW_AT_associated, cu);
-  if (attr != NULL && attr->form_is_block ())
+  if (attr != NULL)
     {
       struct type *prop_type = cu->addr_sized_int_type (false);
       if (attr_to_dynamic_prop (attr, die, cu, &prop, prop_type))
         type->add_dyn_prop (DYN_PROP_ASSOCIATED, prop);
     }
-  else if (attr != NULL)
-    {
-      complaint (_("DW_AT_associated has the wrong form (%s) at DIE %s"),
-                (attr != NULL ? dwarf_form_name (attr->form) : "n/a"),
-                sect_offset_str (die->sect_off));
-    }
 
   /* Read DW_AT_data_location and set in type.  */
   attr = dwarf2_attr (die, DW_AT_data_location, cu);