Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Support constants for DW_AT_data_member_location
@ 2007-11-29  9:54 Vladimir Prus
  2007-11-29 19:39 ` Jim Blandy
  0 siblings, 1 reply; 7+ messages in thread
From: Vladimir Prus @ 2007-11-29  9:54 UTC (permalink / raw)
  To: gdb-patches

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


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.


[-- Attachment #2: constant_data_member_location.diff --]
[-- Type: text/x-diff, Size: 517 bytes --]

--- 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;

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

end of thread, other threads:[~2007-12-17 18:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-29  9:54 Support constants for DW_AT_data_member_location Vladimir Prus
2007-11-29 19:39 ` Jim Blandy
2007-11-29 20:18   ` Vladimir Prus
2007-12-01  1:48     ` Jim Blandy
2007-12-13 17:57       ` Vladimir Prus
2007-12-13 19:29         ` Jim Blandy
2007-12-17 19:30           ` Jim Blandy

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