Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Allow reference form for DW_AT_associated and DW_AT_allocated attributes
@ 2020-07-01  7:01 Sharma, Alok Kumar
  2020-07-01  8:20 ` Andrew Burgess
  0 siblings, 1 reply; 4+ messages in thread
From: Sharma, Alok Kumar @ 2020-07-01  7:01 UTC (permalink / raw)
  To: gdb-patches; +Cc: George, Jini Susan, Achra, Nitika

[-- Attachment #1: Type: text/plain, Size: 816 bytes --]

Hi All,

I request you all to please review this patch. Below are the details.

Problem Description:
    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. 
Resolution:
    Now ' set_die_type' Is modified to accept reference form as well.
This change will not impact testsuite for gfortran, and will fix failures for
Flang compiler with existing testsuite.

    gdb/ChangeLog

            * dwarf2/read.c (set_die_type): Allow reference form for
            DW_AT_associated and DW_AT_allocated attributes.

Please let me know your valuable comments.

Regards,
Alok




[-- Attachment #2: 0001-Allow-reference-form-for-DW_AT_associated-and-DW_AT_.patch --]
[-- Type: application/octet-stream, Size: 2215 bytes --]

From 9a37e9973e513738234b4fed4b66d0ffc1438398 Mon Sep 17 00:00:00 2001
From: alosharm <AlokKumar.Sharma@amd.com>
Date: Wed, 1 Jul 2020 11:53:09 +0530
Subject: [PATCH] Allow reference form for DW_AT_associated and DW_AT_allocated
 attributes

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): Allow reference form for
	DW_AT_associated and DW_AT_allocated attributes.
---
 gdb/ChangeLog     | 5 +++++
 gdb/dwarf2/read.c | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d64f572e07..75ea79471c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2020-07-01  Alok Kumar Sharma  <AlokKumar.Sharma@amd.com>
+
+	* dwarf2/read.c (set_die_type): Allow reference form for
+	DW_AT_associated and DW_AT_allocated attributes.
+
 2020-06-30  Tom Tromey  <tromey@adacore.com>
 
 	* dwarf2/read.c (quirk_rust_enum): Correctly call
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index b097f624b6..0fba590184 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -23859,7 +23859,7 @@ 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 && (attr->form_is_block () || attr->form_is_ref ()))
     {
       struct type *prop_type = cu->addr_sized_int_type (false);
       if (attr_to_dynamic_prop (attr, die, cu, &prop, prop_type))
@@ -23874,7 +23874,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
 
   /* 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 && (attr->form_is_block () || attr->form_is_ref ()))
     {
       struct type *prop_type = cu->addr_sized_int_type (false);
       if (attr_to_dynamic_prop (attr, die, cu, &prop, prop_type))
-- 
2.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-07-01 11:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-01  7:01 [PATCH] Allow reference form for DW_AT_associated and DW_AT_allocated attributes Sharma, Alok Kumar
2020-07-01  8:20 ` Andrew Burgess
2020-07-01  9:37   ` Sharma, Alok Kumar
2020-07-01 11:15     ` Andrew Burgess

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox