This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Support constants for DW_AT_data_member_location


DWARF standard allows DW_AT_data_member_location value
to be a plain constant, but GDB does not. Is the following OK?

- Volodya

	* dwarf2read.c (dwarf2_add_field): Allow
	the DW_AT_data_member_location to be of 
	DW_FORM_udata form.

--- dwarf2read.c	(revision 123)
+++ dwarf2read.c	(local)
@@ -3500,8 +3500,11 @@ dwarf2_add_field (struct field_info *fip
       attr = dwarf2_attr (die, DW_AT_data_member_location, cu);
       if (attr)
 	{
-	  FIELD_BITPOS (*fp) =
-	    decode_locdesc (DW_BLOCK (attr), cu) * bits_per_byte;
+	  if (attr->form == DW_FORM_udata)
+	    FIELD_BITPOS (*fp) = 8 * DW_UNSND (attr);
+	  else
+	    FIELD_BITPOS (*fp) =
+	      decode_locdesc (DW_BLOCK (attr), cu) * bits_per_byte;
 	}
       else
 	FIELD_BITPOS (*fp) = 0;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]