diff mbox

[PR63238] output alignment debug information

Message ID or7f5cfnty.fsf@lxoliva.fsfla.org
State New
Headers show

Commit Message

Alexandre Oliva Jan. 30, 2017, 5:40 p.m. UTC
On Jan 29, 2017, Cary Coutant <ccoutant@gmail.com> wrote:

>> for gcc/ChangeLog
>> 
>> PR debug/63238

> This is OK so far, but the DW_AT_alignment attribute also needs to be
> added to the checksum computation in die_checksum and
> die_checksum_ordered.

Thanks.  I see what to do in die_checksum_ordered, but die_checksum?  It
seems to handle attributes by value class, and AFAICT the classes that
DW_AT_alignment could use are already covered.  What am I missing?

Here's a patch I'm about to start testing.  Does it look ok?


[PR63238] include alignment debug information in DIE checksum

Add DW_AT_alignment to the DIE checksum.
    
for gcc/ChangeLog
    
	PR debug/63238
	* dwarf2out.c (struct checksum_attributes): Add at_alignment.
	(collect_checksum_attributes): Set it.
	(die_checksum_ordered): Use it.
---
 gcc/dwarf2out.c |    5 +++++
 1 file changed, 5 insertions(+)

Comments

Cary Coutant March 17, 2017, 3:13 a.m. UTC | #1
>> This is OK so far, but the DW_AT_alignment attribute also needs to be
>> added to the checksum computation in die_checksum and
>> die_checksum_ordered.
>
> Thanks.  I see what to do in die_checksum_ordered, but die_checksum?  It
> seems to handle attributes by value class, and AFAICT the classes that
> DW_AT_alignment could use are already covered.  What am I missing?
>
> Here's a patch I'm about to start testing.  Does it look ok?

Sorry, I read this while I wasn't in a position to reply, then totally
forgot about it. Yes, you're right about die_checksum, sorry. And, for
the record, it looks OK.

-cary
diff mbox

Patch

diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index f8fe4c1..15b7a66 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -6600,6 +6600,7 @@  struct checksum_attributes
   dw_attr_node *at_friend;
   dw_attr_node *at_accessibility;
   dw_attr_node *at_address_class;
+  dw_attr_node *at_alignment;
   dw_attr_node *at_allocated;
   dw_attr_node *at_artificial;
   dw_attr_node *at_associated;
@@ -6673,6 +6674,9 @@  collect_checksum_attributes (struct checksum_attributes *attrs, dw_die_ref die)
         case DW_AT_address_class:
           attrs->at_address_class = a;
           break;
+	case DW_AT_alignment:
+	  attrs->at_alignment = a;
+	  break;
         case DW_AT_allocated:
           attrs->at_allocated = a;
           break;
@@ -6879,6 +6883,7 @@  die_checksum_ordered (dw_die_ref die, struct md5_ctx *ctx, int *mark)
   CHECKSUM_ATTR (attrs.at_vtable_elem_location);
   CHECKSUM_ATTR (attrs.at_type);
   CHECKSUM_ATTR (attrs.at_friend);
+  CHECKSUM_ATTR (attrs.at_alignment);
 
   /* Checksum the child DIEs.  */
   c = die->die_child;