This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA] handle DW_AT_byte_size for set types
- From: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- To: <gdb-patches at sourceware dot org>
- Date: Mon, 17 May 2010 17:43:15 +0200
- Subject: [RFA] handle DW_AT_byte_size for set types
According to Dwarf 2.0.0 page 46,
DW_TAG_set_type
supports DW_AT_byte_size attribute,
but this is not implemented yet inside GDB.
The patch below implements this,
it will allow to correctly give the value of
constant pascal sets (at least for Free Pascal compiler).
The patch is rather obvious...
Is this OK?
Pierre Muller
Pascal language support maintainer for GDB
2010-05-17 Pierre Muller <muller@ics.u-strasbg.fr>
* dwarf2read.c (read_set_type): Set type length if
DW_AT_byte_size attribute is present.
Index: src/gdb/dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.385
diff -u -p -r1.385 dwarf2read.c
--- src/gdb/dwarf2read.c 14 May 2010 17:53:16 -0000 1.385
+++ src/gdb/dwarf2read.c 17 May 2010 15:33:17 -0000
@@ -5547,7 +5556,10 @@ static struct type *
read_set_type (struct die_info *die, struct dwarf2_cu *cu)
{
struct type *set_type = create_set_type (NULL, die_type (die, cu));
+ struct attribute *attr = dwarf2_attr (die, DW_AT_byte_size, cu);
+ if (attr)
+ TYPE_LENGTH(set_type) = DW_UNSND (attr);
return set_die_type (die, set_type, cu);
}